mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
파일 업로드에 성공한 경우 캐시에도 파일을 저장하도록 개선
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { callGetApi, callPostApi } from "$lib/hooks";
|
||||
import { storeHmacSecrets } from "$lib/indexedDB";
|
||||
import { generateDataKey, wrapDataKey, unwrapHmacSecret, encryptString } from "$lib/modules/crypto";
|
||||
import { deleteFileCache, uploadFile } from "$lib/modules/file";
|
||||
import { storeFileCache, deleteFileCache, uploadFile } from "$lib/modules/file";
|
||||
import type {
|
||||
DirectoryRenameRequest,
|
||||
DirectoryCreateRequest,
|
||||
@@ -63,7 +63,11 @@ export const requestFileUpload = async (
|
||||
masterKey: MasterKey,
|
||||
onDuplicate: () => Promise<boolean>,
|
||||
) => {
|
||||
return await uploadFile(file, parentId, hmacSecret, masterKey, onDuplicate);
|
||||
const res = await uploadFile(file, parentId, hmacSecret, masterKey, onDuplicate);
|
||||
if (!res) return false;
|
||||
|
||||
storeFileCache(res.fileId, res.fileBuffer); // Intended
|
||||
return true;
|
||||
};
|
||||
|
||||
export const requestDirectoryEntryRename = async (
|
||||
|
||||
Reference in New Issue
Block a user