mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Only try to set state values in background script
I'm fairly surprised that this had any persistence at all
This commit is contained in:
parent
090958809e
commit
70a2a3b72c
1 changed files with 2 additions and 2 deletions
|
@ -90,12 +90,12 @@ export async function getAsync(property) {
|
|||
}
|
||||
|
||||
// Keep instances of state.ts synchronised with each other
|
||||
messaging.addListener("state", (message, sender, sendResponse) => {
|
||||
!notBackground() && messaging.addListener("state", (message, sender, sendResponse) => {
|
||||
if (message.command == "stateUpdate") {
|
||||
const property = message.args.property
|
||||
const value = message.args.value
|
||||
logger.debug("State changed!", property, value)
|
||||
overlay[property] = value
|
||||
state[property] = value
|
||||
} else if (message.command == "stateGet") {
|
||||
sendResponse(state[message.args[0].prop])
|
||||
} else throw "Unsupported message to state, type " + message.command
|
||||
|
|
Loading…
Add table
Reference in a new issue