feat: fetch roles at runtime and prepare solver

This commit is contained in:
2026-05-31 23:25:48 +02:00
parent 3968e775cc
commit 64b60b08a7
11 changed files with 151 additions and 30 deletions

View File

@@ -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;
}
});
};