load list of plugins and save to localstorage for online usage

pull/5370/head
yann300 4 years ago
parent af1d2a50b8
commit 6cd9a5ff3f
  1. 18
      apps/remix-ide/src/remixAppManager.js

@ -87,8 +87,22 @@ export class RemixAppManager extends PluginManager {
}
async registeredPlugins () {
const res = await fetch(this.pluginsDirectory)
const plugins = await res.json()
let plugins
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({
name: 'walletconnect',
kind: 'provider',

Loading…
Cancel
Save