saner updatePermission()
This commit is contained in:
@@ -74,13 +74,10 @@ export async function readPermissionLevel(host) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function updatePermission(host, permission) {
|
export async function updatePermission(host, permission) {
|
||||||
browser.storage.local.set({
|
var permissions = await browser.storage.local.get('permissions').permissions
|
||||||
permissions: {
|
permissions[host] = {
|
||||||
...((await browser.storage.local.get('permissions').permissions) || {}),
|
|
||||||
[host]: {
|
|
||||||
...permission,
|
...permission,
|
||||||
created_at: Math.round(Date.now() / 1000)
|
created_at: Math.round(Date.now() / 1000)
|
||||||
}
|
}
|
||||||
}
|
browser.storage.local.set({permissions})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user