forked from jsnbuchanan/crowd-funder-for-time-pwa
add minute to notification scheduling & fix a bug, plus other tweaks
This commit is contained in:
@@ -131,3 +131,16 @@ export async function updateAccountSettings(
|
||||
settings.accountDid = accountDid;
|
||||
await updateSettings(settings);
|
||||
}
|
||||
|
||||
export async function addLogMessage(message: string): Promise<void> {
|
||||
await db.open();
|
||||
const todayKey = new Date().toDateString();
|
||||
// only keep one day's worth of logs
|
||||
const previous = await db.logs.get(todayKey);
|
||||
if (!previous) {
|
||||
// when this is today's first log, clear out everything previous
|
||||
await db.logs.clear();
|
||||
}
|
||||
const fullMessage = (previous && previous.message) || "";
|
||||
await db.logs.update(todayKey, { message: fullMessage + "\n" + message });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user