mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: added reset prompt
This commit is contained in:
1 parent
15f32a0044
commit
49f601d200
2 files changed
+87
-15
No files matched your search
+16
-3
@@ -3,7 +3,7 @@ import { devtools, persist } from 'zustand/middleware';
|
||||
import { Region } from '../constants/regions';
|
||||
import { NormalizedTankStats } from '../types/tanksStats';
|
||||
|
||||
type Session =
|
||||
type Session = (
|
||||
| {
|
||||
isTracking: false;
|
||||
}
|
||||
@@ -15,8 +15,21 @@ type Session =
|
||||
nickname: string;
|
||||
tankStats: NormalizedTankStats;
|
||||
time: number;
|
||||
};
|
||||
}
|
||||
) & {
|
||||
promptBeforeReset: boolean;
|
||||
};
|
||||
|
||||
export const useSession = create<Session>()(
|
||||
devtools(persist((set) => ({ isTracking: false }), { name: 'session' })),
|
||||
devtools(
|
||||
persist(
|
||||
(set) => ({
|
||||
isTracking: false,
|
||||
promptBeforeReset: true,
|
||||
}),
|
||||
{
|
||||
name: 'session',
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
Reference in new issue
Block a user