summaryrefslogtreecommitdiff
path: root/js/toggleTheme.ts
blob: 733a0f3466e7bf4a18efb562cdf4ee4ceb316fe9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/// <reference path="setTheme.ts" />

function toggleTheme() {
	let theme: Theme = JSON.parse(localStorage.getItem("theme")!);

	if (theme == Theme.Light) {
		theme = Theme.Dark;
	} else if (Theme.Dark) {
		theme = Theme.Light;
	}

	setTheme(theme);
}