mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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 = {
|
(draft as SessionTracking).player = {
|
||||||
id: player.account_id,
|
id: player.account_id,
|
||||||
region: player.region,
|
region: player.region,
|
||||||
|
since: Date.now(),
|
||||||
};
|
};
|
||||||
|
|
||||||
input.current.value = player.nickname;
|
input.current.value = player.nickname;
|
||||||
@@ -268,19 +269,25 @@ export default function Page() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{session.tracking && (
|
{session.tracking && (
|
||||||
<Flex gap="4" align="center" justify="center" mt="2">
|
<Flex mt="2" mb="2" direction="column" align="center" gap="2">
|
||||||
<Heading size="5">Tracking {accountInfo?.nickname}</Heading>
|
<Flex gap="4" align="center" justify="center">
|
||||||
<Button
|
<Heading size="5">Tracking {accountInfo?.nickname}</Heading>
|
||||||
color="red"
|
<Button
|
||||||
variant="ghost"
|
color="red"
|
||||||
onClick={() => {
|
variant="ghost"
|
||||||
mutateSession((draft) => {
|
onClick={() => {
|
||||||
draft.tracking = false;
|
mutateSession((draft) => {
|
||||||
});
|
draft.tracking = false;
|
||||||
}}
|
});
|
||||||
>
|
}}
|
||||||
Stop
|
>
|
||||||
</Button>
|
Stop
|
||||||
|
</Button>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<Text color="gray">
|
||||||
|
Since {new Date(session.player.since).toLocaleString()}
|
||||||
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export interface SessionTracking extends SessionBase {
|
|||||||
player: {
|
player: {
|
||||||
id: number;
|
id: number;
|
||||||
region: Region;
|
region: Region;
|
||||||
|
since: number;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user