load list of plugins and save to localstorage for online usage

pull/653/head
yann300 4 years ago
parent 8fb9b1126f
commit 98abe690d3
  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