this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: add stable app_id

+16 -7
+7 -3
www/models/app.ts
··· 24 24 import { defaultFlags, defaultSettings, defaultUserLevels } from './schema.ts' 25 25 import { Locale, Transliteration } from '$/enums.ts' 26 26 27 + export const APP_ID = 'me.bpev.hanzi' 28 + export const CUSTOM_SETS_APP_ID = 'me.bpev.hanzi.custom' 29 + export const AUDIO_APP_ID = 'me.bpev.hanzi.audio' 30 + 27 31 const defaultStats: Stats = { 28 32 currStreak: 0, 29 33 longestStreak: 0, ··· 82 86 synced: Synced 83 87 84 88 constructor(store?: Store) { 85 - const s = store ?? createStore(new IDBStorage({ dbName: 'bpev-hanzi' })) 89 + const s = store ?? createStore(new IDBStorage({ dbName: APP_ID })) 86 90 this.#store = s 87 91 this.#settingsDoc = s.document<Settings>('settings', defaultSettings) 88 92 this.#flagsDoc = s.document<Flags>('flags', defaultFlags) ··· 100 104 this.#overridesColl, 101 105 this.#journalColl, 102 106 ], 103 - appId: 'bpev-hanzi', 107 + appId: APP_ID, 104 108 }) 105 109 106 110 s.subscribe(() => this.#notify()) ··· 543 547 try { 544 548 await this.dispose() 545 549 await new Promise<void>((resolve, reject) => { 546 - const req = indexedDB.deleteDatabase('bpev-hanzi') 550 + const req = indexedDB.deleteDatabase(APP_ID) 547 551 req.onsuccess = () => resolve() 548 552 req.onerror = () => reject(req.error) 549 553 req.onblocked = () => resolve()
+6 -2
www/routes/settings.ts
··· 1 1 import { html, LitElement, TemplateResult } from 'lit' 2 2 import type { StoreImportMethods } from '@civility/ui' 3 3 import getString from '$/utils/get_string.ts' 4 - import app from '$/models/app.ts' 4 + import app, { APP_ID } from '$/models/app.ts' 5 5 import { CardSortMethod } from '@flashcard/core' 6 6 7 7 type NumInputKey = ··· 123 123 <ui-pwa-install></ui-pwa-install> 124 124 <a href="#!/settings/about" class="settings-nav-link"> 125 125 <span>${getString('about')}</span> 126 + <ui-icon name="arrow-right" label="${getString('games')}"></ui-icon> 126 127 </a> 127 128 </section> 128 129 ··· 160 161 </div> 161 162 <a href="#!/settings/downloads" class="settings-nav-link"> 162 163 <span>${getString('download_audio')}</span> 164 + <ui-icon name="arrow-right" label="${getString('games')}"></ui-icon> 163 165 </a> 164 166 <a href="#!/settings/assignments" class="settings-nav-link"> 165 167 <span>${getString('mark_known')}</span> 168 + <ui-icon name="arrow-right" label="${getString('games')}"></ui-icon> 166 169 </a> 167 170 <a href="#!/settings/custom-sets" class="settings-nav-link"> 168 171 <span>${getString('custom_sets')}</span> 172 + <ui-icon name="arrow-right" label="${getString('games')}"></ui-icon> 169 173 </a> 170 174 <a href="javascript:void(0)" class="settings-nav-link" @click="${async (e: MouseEvent) => { 171 175 e.preventDefault() ··· 199 203 <h2>${getString('sync')}</h2> 200 204 <p>${getString('sync_hint') || 'Sync your progress across devices.'}</p> 201 205 <ui-sync-input 202 - storage-key="hanzi-sync" 206 + app-id="${APP_ID}" 203 207 .synced="${app.synced}" 204 208 ></ui-sync-input> 205 209 </section>
+1 -1
www/utils/audio.ts
··· 1 1 import { get, has, keys, remove, set } from '@byojs/storage/idb' 2 2 import { DownloadStatus, Locale } from '$/enums.ts' 3 - import app from '$/models/app.ts' 3 + import app, { AUDIO_APP_ID } from '$/models/app.ts' 4 4 import downloads, { Download, Downloads } from '$/models/downloads.ts' 5 5 import { subjects } from '$/models/subjects.ts' 6 6
+2 -1
www/utils/custom_sets.ts
··· 1 1 import { Collection } from '@civility/store' 2 2 import { IDBStorage } from '@civility/store/idb' 3 + import { CUSTOM_SETS_APP_ID } from '../models/app.ts' 3 4 4 5 export interface CustomSet { 5 6 id: string ··· 14 15 } 15 16 16 17 const storage = new IDBStorage<CustomSetData>({ 17 - dbName: 'bpev-hanzi-custom-sets', 18 + dbName: CUSTOM_SETS_APP_ID, 18 19 }) 19 20 const customSets = new Collection<CustomSetData>(storage, { name: 'sets' }) 20 21