Commit 98abe690 authored by yann300's avatar yann300

load list of plugins and save to localstorage for online usage

parent 8fb9b112
...@@ -87,8 +87,22 @@ export class RemixAppManager extends PluginManager { ...@@ -87,8 +87,22 @@ export class RemixAppManager extends PluginManager {
} }
async registeredPlugins () { async registeredPlugins () {
const res = await fetch(this.pluginsDirectory) let plugins
const plugins = await res.json() try {
const res = await fetch(this.pluginsDirectory)
plugins = await res.json()
localStorage.setItem('plugins-directory', JSON.stringify(plugins))
} catch (e) {
console.log('getting plugins list from localstorage...')
const savedPlugins = localStorage.getItem('plugins-directory')
if (savedPlugins) {
try {
plugin = JSON.parse(savedPlugins)
} catch (e) {
console.error(e)
}
}
}
plugins.push({ plugins.push({
name: 'walletconnect', name: 'walletconnect',
kind: 'provider', kind: 'provider',
......
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