feat: fetch roles at runtime and prepare solver
This commit is contained in:
@@ -35,14 +35,14 @@ const onKeyDown = (event: KeyboardEvent): void => {
|
||||
const init = async (): Promise<void> => {
|
||||
const result = await chrome.storage.local.get(STORAGE_KEY);
|
||||
const state = result[STORAGE_KEY] as State | undefined;
|
||||
enabled = state?.enabled ?? true;
|
||||
enabled = state?.keybinds ?? true;
|
||||
|
||||
document.addEventListener("keydown", onKeyDown, { capture: true });
|
||||
|
||||
chrome.storage.onChanged.addListener((changes) => {
|
||||
if (STORAGE_KEY in changes) {
|
||||
const next = changes[STORAGE_KEY].newValue as State;
|
||||
enabled = next.enabled;
|
||||
enabled = next.keybinds;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user