1 2 3 4 5 6 7 8 9 10 11 12 13
/// <reference path="setTheme.ts" /> function getTheme(): Theme { let theme = Theme.Dark; try { theme = JSON.parse(localStorage.getItem("theme")!); } catch (e: any) { console.log("invalid theme, using dark"); } return theme; }