mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: since timer
This commit is contained in:
1 parent
e740274e5a
commit
d56be26db2
2 files changed
+21
-13
No files matched your search
@@ -249,6 +249,7 @@ export default function Page() {
|
||||
(draft as SessionTracking).player = {
|
||||
id: player.account_id,
|
||||
region: player.region,
|
||||
since: Date.now(),
|
||||
};
|
||||
|
||||
input.current.value = player.nickname;
|
||||
@@ -268,19 +269,25 @@ export default function Page() {
|
||||
)}
|
||||
|
||||
{session.tracking && (
|
||||
<Flex gap="4" align="center" justify="center" mt="2">
|
||||
<Heading size="5">Tracking {accountInfo?.nickname}</Heading>
|
||||
<Button
|
||||
color="red"
|
||||
variant="ghost"
|
||||
onClick={() => {
|
||||
mutateSession((draft) => {
|
||||
draft.tracking = false;
|
||||
});
|
||||
}}
|
||||
>
|
||||
Stop
|
||||
</Button>
|
||||
<Flex mt="2" mb="2" direction="column" align="center" gap="2">
|
||||
<Flex gap="4" align="center" justify="center">
|
||||
<Heading size="5">Tracking {accountInfo?.nickname}</Heading>
|
||||
<Button
|
||||
color="red"
|
||||
variant="ghost"
|
||||
onClick={() => {
|
||||
mutateSession((draft) => {
|
||||
draft.tracking = false;
|
||||
});
|
||||
}}
|
||||
>
|
||||
Stop
|
||||
</Button>
|
||||
</Flex>
|
||||
|
||||
<Text color="gray">
|
||||
Since {new Date(session.player.since).toLocaleString()}
|
||||
</Text>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface SessionTracking extends SessionBase {
|
||||
player: {
|
||||
id: number;
|
||||
region: Region;
|
||||
since: number;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user