mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
IndexedDB에 즐겨찾기 여부를 항상 저장하도록 변경
This commit is contained in:
@@ -4,7 +4,7 @@ interface DirectoryInfo {
|
||||
id: number;
|
||||
parentId: DirectoryId;
|
||||
name: string;
|
||||
isFavorite?: boolean;
|
||||
isFavorite: boolean;
|
||||
}
|
||||
|
||||
interface FileInfo {
|
||||
@@ -15,7 +15,7 @@ interface FileInfo {
|
||||
createdAt?: Date;
|
||||
lastModifiedAt: Date;
|
||||
categoryIds?: number[];
|
||||
isFavorite?: boolean;
|
||||
isFavorite: boolean;
|
||||
}
|
||||
|
||||
interface CategoryInfo {
|
||||
@@ -48,6 +48,23 @@ filesystem
|
||||
});
|
||||
});
|
||||
|
||||
filesystem.version(4).upgrade(async (trx) => {
|
||||
await Promise.all([
|
||||
trx
|
||||
.table("directory")
|
||||
.toCollection()
|
||||
.modify((directory) => {
|
||||
directory.isFavorite = false;
|
||||
}),
|
||||
trx
|
||||
.table("file")
|
||||
.toCollection()
|
||||
.modify((file) => {
|
||||
file.isFavorite = false;
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
export const getDirectoryInfos = async (parentId: DirectoryId) => {
|
||||
return await filesystem.directory.where({ parentId }).toArray();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user