diff options
| author | Fuwn <[email protected]> | 2024-07-24 21:24:09 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-07-24 21:24:09 -0700 |
| commit | 8a94bbfba322f8011017980e4362d46c4d51bb55 (patch) | |
| tree | 4d861cd7f1d9304e6297e1b52fe759674fd5df1a /src/lib/Database/user.ts | |
| parent | feat(layout): browser notifications (diff) | |
| download | due.moe-8a94bbfba322f8011017980e4362d46c4d51bb55.tar.xz due.moe-8a94bbfba322f8011017980e4362d46c4d51bb55.zip | |
feat: background notifications
Diffstat (limited to 'src/lib/Database/user.ts')
| -rw-r--r-- | src/lib/Database/user.ts | 23 |
1 files changed, 23 insertions, 0 deletions
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<User>; + + constructor() { + super('users'); + this.version(1).stores({ + users: 'id, user, lastNotificationID' + }); + + this.users = this.table('users'); + } +} + +export const database = new UserDatabase(); |