mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 09:16:13 +08:00
impr: use authentication state instead of the dom
!nuf
This commit is contained in:
parent
90e3ad4957
commit
6c9148624e
1 changed files with 2 additions and 4 deletions
|
|
@ -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");
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue