sidebar is react, fix a few bugs

This commit is contained in:
Olivier Gagnon
2021-09-11 01:54:19 -04:00
parent 4bedf05b1c
commit add19d353e
28 changed files with 458 additions and 798 deletions
+4 -3
View File
@@ -56,6 +56,7 @@ export const MainMenuLinks: IMainMenuLinks = {
};
export function initializeMainMenuLinks(): boolean {
return true;
try {
function safeGetLink(id: string): HTMLElement {
const elem: HTMLElement | null = clearEventListeners(id);
@@ -84,9 +85,9 @@ export function initializeMainMenuLinks(): boolean {
MainMenuLinks.Gang = safeGetLink("gang-menu-link");
MainMenuLinks.Milestones = safeGetLink("milestones-menu-link");
MainMenuLinks.Tutorial = safeGetLink("tutorial-menu-link");
const op: HTMLElement | null = document.getElementById("options-menu-link");
if (op === null) throw new Error(`Could not find element with id: "options-menu-link"`);
MainMenuLinks.Options = op; // This click listener is already set, so don't clear it
// const op: HTMLElement | null = document.getElementById("options-menu-link");
// if (op === null) throw new Error(`Could not find element with id: "options-menu-link"`);
// MainMenuLinks.Options = op; // This click listener is already set, so don't clear it
MainMenuLinks.DevMenu = safeGetLink("dev-menu-link");
return true;