From 3024c96c942c43c375dea4189e331d6134ef12b5 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sun, 27 Feb 2022 23:33:59 +0100 Subject: [PATCH] rename --- apps/remix-ide/src/app/components/preload.tsx | 8 ++------ apps/remix-ide/src/app/files/fileSystem.ts | 4 ++-- .../{migrateFileSystem.ts => fileSystemUtility.ts} | 0 3 files changed, 4 insertions(+), 8 deletions(-) rename apps/remix-ide/src/app/files/filesystems/{migrateFileSystem.ts => fileSystemUtility.ts} (100%) diff --git a/apps/remix-ide/src/app/components/preload.tsx b/apps/remix-ide/src/app/components/preload.tsx index e778d610de..3ac91af9fb 100644 --- a/apps/remix-ide/src/app/components/preload.tsx +++ b/apps/remix-ide/src/app/components/preload.tsx @@ -5,7 +5,7 @@ import * as packageJson from '../../../../../package.json' import { fileSystem, fileSystems } from '../files/fileSystem' import { indexedDBFileSystem } from '../files/filesystems/indexedDB' import { localStorageFS } from '../files/filesystems/localStorage' -import { fileSystemUtility } from '../files/filesystems/migrateFileSystem' +import { fileSystemUtility } from '../files/filesystems/fileSystemUtility' import './preload.css' export const Preload = () => { @@ -40,10 +40,6 @@ export const Preload = () => { await migrateAndLoad() } - const skipBackup = async () => { - await migrateAndLoad() - } - const migrateAndLoad = async () => { const fsUtility = new fileSystemUtility() await fsUtility.migrate(localStorageFileSystem.current, remixIndexedDB.current) @@ -97,7 +93,7 @@ export const Preload = () => {

You don't need to do anything else, your files will be available when the app loads.
{ await downloadBackup() }} className='btn btn-primary mt-1'>download backup
-
{ await skipBackup() }} className='btn btn-primary mt-1'>skip backup
+
{ await migrateAndLoad() }} className='btn btn-primary mt-1'>skip backup
: null} {(supported && !error && !showDownloader) ?
diff --git a/apps/remix-ide/src/app/files/fileSystem.ts b/apps/remix-ide/src/app/files/fileSystem.ts index 8e37260de1..956f2d6b43 100644 --- a/apps/remix-ide/src/app/files/fileSystem.ts +++ b/apps/remix-ide/src/app/files/fileSystem.ts @@ -54,10 +54,10 @@ export class fileSystems { this.fileSystems = {} } - addFileSystem = async (fs: fileSystem) => { + addFileSystem = async (fs: fileSystem): Promise => { try { this.fileSystems[fs.name] = fs - if (await fs.test()) await fs.load() + await fs.test() && await fs.load() console.log(fs.name + ' is loaded...') return true } catch (e) { diff --git a/apps/remix-ide/src/app/files/filesystems/migrateFileSystem.ts b/apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts similarity index 100% rename from apps/remix-ide/src/app/files/filesystems/migrateFileSystem.ts rename to apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts