Skip to content

Commit ef5ef0c

Browse files
authored
feat(commandline): add sign out (@fehmer) (monkeytypegame#7283)
1 parent d11bdaa commit ef5ef0c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

frontend/src/ts/commandline/lists.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import * as FPSCounter from "../elements/fps-counter";
3131
import { Command, CommandsSubgroup } from "./types";
3232
import { buildCommandForConfigKey } from "./util";
3333
import { CommandlineConfigMetadataObject } from "./commandline-metadata";
34+
import { isAuthAvailable, isAuthenticated, signOut } from "../firebase";
3435

3536
const challengesPromise = JSONData.getChallengeList();
3637
challengesPromise
@@ -366,6 +367,17 @@ export const commands: CommandsSubgroup = {
366367
window.open("https://discord.gg/monkeytype");
367368
},
368369
},
370+
{
371+
id: "signOut",
372+
display: "Sign out",
373+
icon: "fa-sign-out-alt",
374+
exec: (): void => {
375+
void signOut();
376+
},
377+
available: () => {
378+
return isAuthAvailable() && isAuthenticated();
379+
},
380+
},
369381
],
370382
};
371383

0 commit comments

Comments
 (0)