impr: use authentication state instead of the dom

!nuf
This commit is contained in:
Miodec 2024-08-09 11:55:54 +02:00
parent 90e3ad4957
commit 6c9148624e

View file

@ -1,4 +1,5 @@
import { navigate } from "../../controllers/route-controller";
import { isAuthenticated } from "../../firebase";
import { toggleFullscreen } from "../../utils/misc";
const commands: MonkeyTypes.Command[] = [
@ -45,10 +46,7 @@ const commands: MonkeyTypes.Command[] = [
alias: "navigate go to stats",
icon: "fa-user",
exec: (): void => {
//todo probably base this on some state instead of the dom
$("header nav .textButton.view-account").hasClass("hidden")
? navigate("/login")
: navigate("/account");
isAuthenticated() ? navigate("/account") : navigate("/login");
},
},
{