From 0567602dcbbbfc14f24dbc31173bb58500a049ed Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Mar 2022 14:33:52 +0100 Subject: [PATCH] do not crash if localstorage is full --- .../src/app/plugins/permission-handler-plugin.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx index 1b947d75dd..22412ed9e8 100644 --- a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx +++ b/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 { } }) } -} \ No newline at end of file +}