diff --git a/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx b/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx index d00ed34af7..6dba54afc5 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx @@ -10,17 +10,21 @@ interface PermissionSettingsProps { } function PermisssionsSettings ({ pluginSettings }: PermissionSettingsProps) { - const [modalVisibility, setModalVisibility] = useState(true) const [permissions, setPermissions] = useLocalStorage('plugins/permissions', {} as PluginPermissions) - + const [permissionCache, setpermissionCache] = useState() const closeModal = () => setModalVisibility(true) const openModal = () => { const currentValue = JSON.parse(window.localStorage.getItem('plugins/permissions') || '{}') + setpermissionCache(currentValue) setPermissions(currentValue) setModalVisibility(!modalVisibility) } + const cancel = () => { + setPermissions(permissionCache) + } + const getState = (targetPlugin:string, funcName:string, pluginName :string) => { return permissions[targetPlugin][funcName][pluginName].allow } @@ -103,6 +107,7 @@ function PermisssionsSettings ({ pluginSettings }: PermissionSettingsProps) { { Object.keys(permissions).map(targetPlugin => ( - <> - - - +
+ + +
)) }