mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-12 21:08:46 +00:00
비효율적인 디렉터리 페이지 자동 갱신 구현
This commit is contained in:
@@ -37,13 +37,16 @@
|
||||
const createDirectory = async (name: string) => {
|
||||
await requestDirectoryCreation(name, data.id, $masterKeyStore?.get(1)!);
|
||||
isCreateDirectoryModalOpen = false;
|
||||
info = getDirectoryInfo(data.id, $masterKeyStore?.get(1)?.key!); // TODO: FIXME
|
||||
};
|
||||
|
||||
const uploadFile = () => {
|
||||
const file = fileInput?.files?.[0];
|
||||
if (!file) return;
|
||||
|
||||
requestFileUpload(file, data.id, $masterKeyStore?.get(1)!);
|
||||
requestFileUpload(file, data.id, $masterKeyStore?.get(1)!).then(() => {
|
||||
info = getDirectoryInfo(data.id, $masterKeyStore?.get(1)?.key!); // TODO: FIXME
|
||||
});
|
||||
};
|
||||
|
||||
$effect(() => {
|
||||
@@ -114,6 +117,7 @@
|
||||
bind:selectedEntry
|
||||
onRenameClick={async (newName) => {
|
||||
await requestDirectoryEntryRename(selectedEntry!, newName);
|
||||
info = getDirectoryInfo(data.id, $masterKeyStore?.get(1)?.key!); // TODO: FIXME
|
||||
return true;
|
||||
}}
|
||||
/>
|
||||
@@ -122,6 +126,7 @@
|
||||
bind:selectedEntry
|
||||
onDeleteClick={async () => {
|
||||
await requestDirectoryEntryDeletion(selectedEntry!);
|
||||
info = getDirectoryInfo(data.id, $masterKeyStore?.get(1)?.key!); // TODO: FIXME
|
||||
return true;
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -29,7 +29,7 @@ export const requestDirectoryCreation = async (
|
||||
) => {
|
||||
const { dataKey, dataKeyVersion } = await generateDataKey();
|
||||
const nameEncrypted = await encryptData(new TextEncoder().encode(name), dataKey);
|
||||
return await callPostApi<DirectoryCreateRequest>("/api/directory/create", {
|
||||
await callPostApi<DirectoryCreateRequest>("/api/directory/create", {
|
||||
parentId,
|
||||
mekVersion: masterKey.version,
|
||||
dek: await wrapDataKey(dataKey, masterKey.key),
|
||||
|
||||
@@ -12,6 +12,9 @@ const config = {
|
||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
||||
adapter: adapter(),
|
||||
csrf: {
|
||||
checkOrigin: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -9,4 +9,7 @@ export default defineConfig({
|
||||
compiler: "svelte",
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
host: true,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user