mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-12-06 19:56:45 +10:30
33 lines
940 B
TypeScript
33 lines
940 B
TypeScript
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
|
|
import { addShortcuts } from "@/seqta/utils/adders/AddShortcuts";
|
|
import { CreateCustomShortcutDiv } from "@/seqta/utils/createEnable/CreateCustomShortcutDiv";
|
|
|
|
export function renderShortcuts() {
|
|
const container = document.getElementById("shortcuts");
|
|
if (!container) return;
|
|
|
|
container.innerHTML = "";
|
|
|
|
try {
|
|
addShortcuts(settingsState.shortcuts || []);
|
|
} catch (err: unknown) {
|
|
console.error(
|
|
"[BetterSEQTA+] Error adding built-in shortcuts:",
|
|
err instanceof Error ? err.message : err,
|
|
);
|
|
}
|
|
|
|
const custom = settingsState.customshortcuts || [];
|
|
for (const element of custom) {
|
|
try {
|
|
CreateCustomShortcutDiv(element);
|
|
} catch (err: unknown) {
|
|
console.error(
|
|
"[BetterSEQTA+] Error adding custom shortcut:",
|
|
element?.name,
|
|
err instanceof Error ? err.message : err,
|
|
);
|
|
}
|
|
}
|
|
}
|