do not crash if localstorage is full

yann300-patch-40
yann300 3 years ago committed by GitHub
parent 67993f5019
commit 0567602dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx

@ -33,7 +33,11 @@ export class PermissionHandlerPlugin extends Plugin {
persistPermissions() {
const permissions = JSON.stringify(this.permissions)
localStorage.setItem('plugins/permissions', permissions)
try {
localStorage.setItem('plugins/permissions', permissions)
} catch (e) {
console.log(e)
}
}
switchMode (from: Profile, to: Profile, method: string, set: boolean) {
@ -123,4 +127,4 @@ export class PermissionHandlerPlugin extends Plugin {
}
})
}
}
}

Loading…
Cancel
Save