Browse Source

use constants for fileDb name

Abhinav-grd 4 years ago
parent
commit
21297e6e73
1 changed files with 3 additions and 1 deletions
  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;
 };