web: fix type errors

This commit is contained in:
Abdullah Atta
2024-09-02 13:43:05 +05:00
parent 51a253f3e2
commit a61f2efacf
4 changed files with 6 additions and 1 deletions

View File

@@ -50,6 +50,7 @@ function Header(props: HeaderProps) {
const id =
(await db.tags.find(value))?.id ??
(await db.tags.add({ title: value }));
if (!id) return;
await db.relations.add({ id, type: "tag" }, { type: "note", id: noteId });
await useTagStore.getState().refresh();
}

View File

@@ -49,6 +49,8 @@ export const AddNotebookDialog = DialogManager.register(
title: title.current,
description: description.current
});
if (!id) return;
if (parentId) {
await db.relations.add(
{ type: "notebook", id: parentId },

View File

@@ -22,7 +22,7 @@ const FEATURE_CHECKS = {
cache: false,
indexedDB: false,
clonableCryptoKey: false,
applePaySupported: window.ApplePaySession?.canMakePayments()
applePaySupported: !!window.ApplePaySession?.canMakePayments()
};
async function isOPFSSupported() {

View File

@@ -145,6 +145,7 @@ async function processNote(entry: ZipEntry, attachments: Record<string, any>) {
(await db.tags.add({
title: tag
}));
if (!tagId) continue;
await db.relations.add(
{
@@ -166,6 +167,7 @@ async function processNote(entry: ZipEntry, attachments: Record<string, any>) {
colorCode: colorCode,
title: note.color
}));
if (!colorId) return;
await db.relations.add(
{