🚧 WIP(custom): optimize gallery db sync logic and force refresh gallery

This commit is contained in:
Kuingsmile
2025-12-31 10:29:03 +08:00
parent 6a8d3f6bbf
commit 0ae680d136
7 changed files with 68 additions and 37 deletions

View File

@@ -107,8 +107,8 @@ class GalleryDB {
console.log('init gallery db')
}
static getInstance(): DBStore {
if (!GalleryDB.#instance) {
static getInstance(forceRefresh: boolean = false): DBStore {
if (!GalleryDB.#instance || forceRefresh) {
GalleryDB.#instance = new DBStore(DB_PATH, 'gallery')
}
return GalleryDB.#instance