From 8a94bbfba322f8011017980e4362d46c4d51bb55 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 24 Jul 2024 21:24:09 -0700 Subject: feat: background notifications --- src/lib/Database/user.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/lib/Database/user.ts (limited to 'src/lib/Database/user.ts') diff --git a/src/lib/Database/user.ts b/src/lib/Database/user.ts new file mode 100644 index 00000000..df68bc91 --- /dev/null +++ b/src/lib/Database/user.ts @@ -0,0 +1,23 @@ +import { type AniListAuthorisation } from '$lib/Data/AniList/identity'; +import Dexie, { type Table } from 'dexie'; + +export interface User { + id: number; + user: AniListAuthorisation; + lastNotificationID: number | null; +} + +export class UserDatabase extends Dexie { + users: Table; + + constructor() { + super('users'); + this.version(1).stores({ + users: 'id, user, lastNotificationID' + }); + + this.users = this.table('users'); + } +} + +export const database = new UserDatabase(); -- cgit v1.2.3