Fix missing all chat folder on startup without new manifest

This commit is contained in:
Jamie Kyle
2025-10-01 16:59:29 -07:00
committed by GitHub
parent bf217a8513
commit 4973b9b204
9 changed files with 192 additions and 92 deletions

View File

@@ -146,6 +146,19 @@ export function createChatFolder(db: WritableDB, chatFolder: ChatFolder): void {
})();
}
export function hasAllChatsChatFolder(db: ReadableDB): boolean {
const [query, params] = sql`
SELECT EXISTS (
SELECT 1 FROM chatFolders
WHERE folderType IS ${ChatFolderType.ALL}
AND deletedAtTimestampMs IS 0
LIMIT 1
)
`;
const result = db.prepare(query, { pluck: true }).get<number>(params);
return result === 1;
}
export function createAllChatsChatFolder(db: WritableDB): ChatFolder {
return db.transaction(() => {
const allChatsChatFolder: ChatFolder = {