Save score in IndexedDB

This commit is contained in:
2024-02-18 15:17:23 +01:00
parent 8219634b9c
commit 2b29a8e4b2
6 changed files with 69 additions and 6 deletions
+2 -3
View File
@@ -39,9 +39,8 @@ const LeaderBoard = () => {
useEffect(() => {
const getData = async () => {
const storeData = await store.getItem<LeaderBoardItem[]>('leaderboard');
if (storeData) {
setData(storeData);
}
setData(storeData || []);
};
if (data.length === 0) {