default permissions to empty object
if there are no existing permissions, updatePermissions will error when setting the host permissions. this defaults permissions to empty object (exactly like readPermissions does)
This commit is contained in:
@@ -74,7 +74,7 @@ export async function readPermissionLevel(host) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function updatePermission(host, permission) {
|
export async function updatePermission(host, permission) {
|
||||||
var permissions = await browser.storage.local.get('permissions').permissions
|
let {permissions = {}} = await browser.storage.local.get('permissions')
|
||||||
permissions[host] = {
|
permissions[host] = {
|
||||||
...permission,
|
...permission,
|
||||||
created_at: Math.round(Date.now() / 1000)
|
created_at: Math.round(Date.now() / 1000)
|
||||||
|
|||||||
Reference in New Issue
Block a user