Unverified Commit b4ba04d6 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #2372 from ethereum/fix_removing_storage

Do not remove the old file structure
parents 5aa8cd85 ac2a0d13
...@@ -6,13 +6,17 @@ import { Storage } from 'remix-lib' ...@@ -6,13 +6,17 @@ import { Storage } from 'remix-lib'
*/ */
export default (fileProvider) => { export default (fileProvider) => {
const fileStorage = new Storage('sol:') const fileStorage = new Storage('sol:')
if (fileStorage.keys().length === 0) return const flag = 'status'
const fileStorageBrowserFS = new Storage('remix_browserFS_migration:')
if (fileStorageBrowserFS.get(flag) === 'done') return
fileStorage.keys().forEach((path) => { fileStorage.keys().forEach((path) => {
if (path !== '.remix.config') { if (path !== '.remix.config') {
const content = fileStorage.get(path) const content = fileStorage.get(path)
fileProvider.set(path, content) fileProvider.set(path, content)
fileStorage.remove(path) // TODO https://github.com/ethereum/remix-ide/issues/2377
// fileStorage.remove(path) we don't want to remove it as we are still supporting the old version
console.log('file migrated', path) console.log('file migrated', path)
} }
}) })
fileStorageBrowserFS.set(flag, 'done')
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment