mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-25 20:01:03 +00:00
feat: sidebar badge on new game download option
This commit is contained in:
16
src/main/level/sublevels/downloadSourcesCheckTimestamp.ts
Normal file
16
src/main/level/sublevels/downloadSourcesCheckTimestamp.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { levelKeys } from "./keys";
|
||||
import { db } from "../level";
|
||||
|
||||
export const getLastDownloadSourcesCheck = async (): Promise<string | null> => {
|
||||
try {
|
||||
const timestamp = await db.get(levelKeys.lastDownloadSourcesCheck);
|
||||
return timestamp;
|
||||
} catch (error) {
|
||||
// Key doesn't exist yet
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export const updateLastDownloadSourcesCheck = async (timestamp: string): Promise<void> => {
|
||||
await db.put(levelKeys.lastDownloadSourcesCheck, timestamp);
|
||||
};
|
||||
@@ -7,3 +7,4 @@ export * from "./game-achievements";
|
||||
export * from "./keys";
|
||||
export * from "./themes";
|
||||
export * from "./download-sources";
|
||||
export * from "./downloadSourcesCheckTimestamp";
|
||||
|
||||
@@ -18,4 +18,5 @@ export const levelKeys = {
|
||||
screenState: "screenState",
|
||||
rpcPassword: "rpcPassword",
|
||||
downloadSources: "downloadSources",
|
||||
lastDownloadSourcesCheck: "lastDownloadSourcesCheck",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user