浏览代码

use constants for fileDb name

Abhinav-grd 4 年之前
父节点
当前提交
21297e6e73
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/services/fileService.ts

+ 3 - 1
src/services/fileService.ts

@@ -16,6 +16,8 @@ localForage.config({
     storeName: 'files',
 });
 
+const FILES = 'files';
+
 export interface fileAttribute {
     encryptedData: Uint8Array | string;
     decryptionHeader: string;
@@ -62,7 +64,7 @@ export const syncData = async (token, collections) => {
 };
 
 export const localFiles = async () => {
-    let files: Array<file> = (await localForage.getItem<file[]>('files')) || [];
+    let files: Array<file> = (await localForage.getItem<file[]>(FILES)) || [];
     return files;
 };