TagSpaces is an offline, open source, document manager with tagging support
e2e fix
sytolk9d2969d9ff9e
diff --git a/src/renderer/components/EditDescriptionButtons.tsx b/src/renderer/components/EditDescriptionButtons.tsxindex fa37bd040..b49898ead 100644--- a/src/renderer/components/EditDescriptionButtons.tsx+++ b/src/renderer/components/EditDescriptionButtons.tsx@@ -100,7 +100,7 @@ const EditDescriptionButtons: React.FC<ButtonsProps> = ({const saveAsMarkdown = () => {setAnchorEl(null);- if (openedEntry.meta.description) {+ if (openedEntry.meta?.description) {const blob = new Blob([openedEntry.meta.description], {type: 'text/markdown',});diff --git a/src/renderer/components/LinksTab.tsx b/src/renderer/components/LinksTab.tsxindex c6b1cfde5..938d9be3b 100644--- a/src/renderer/components/LinksTab.tsx+++ b/src/renderer/components/LinksTab.tsx@@ -61,7 +61,7 @@ function LinksTab(props: Props) {indexExist.current = false;// links from descriptionif (openedEntry.meta?.description) {- const descriptionLinks = extractLinks(openedEntry.meta.description);+ const descriptionLinks = extractLinks(openedEntry.meta?.description);if (descriptionLinks && descriptionLinks.length > 0) {links.current = descriptionLinks;}diff --git a/src/renderer/components/chat/AiGenDescButton.tsx b/src/renderer/components/chat/AiGenDescButton.tsxindex ac70632b1..343c1844e 100644--- a/src/renderer/components/chat/AiGenDescButton.tsx+++ b/src/renderer/components/chat/AiGenDescButton.tsx@@ -74,10 +74,10 @@ function AiGenDescButton(props: Props) {setIsLoading(false);if (entry.uuid === openedEntry.uuid) {dispatch(SettingsActions.setEntryContainerTab(TabNames.descriptionTab));- setDescription(entry.meta.description);+ setDescription(entry.meta?.description);return saveDescription().then(handleResult);} else {- return setDescriptionChange(entry, entry.meta.description).then(+ return setDescriptionChange(entry, entry.meta?.description).then(handleResult,);}diff --git a/src/renderer/hooks/ChatProvider.tsx b/src/renderer/hooks/ChatProvider.tsxindex 487f13e1c..ca3145dbe 100644--- a/src/renderer/hooks/ChatProvider.tsx+++ b/src/renderer/hooks/ChatProvider.tsx@@ -1304,7 +1304,7 @@ export const ChatContextProvider = ({ children }: ChatContextProviderProps) => {const ext = extractFileExtension(entry.name).toLowerCase();if ((fromDescription || generationSettings.current.fromDescription) &&- entry.meta.description+ entry.meta?.description) {return newChatMessage(entry.meta.description,diff --git a/src/renderer/hooks/OpenedEntryContextProvider.tsx b/src/renderer/hooks/OpenedEntryContextProvider.tsxindex ef3582fef..8573d00d4 100644--- a/src/renderer/hooks/OpenedEntryContextProvider.tsx+++ b/src/renderer/hooks/OpenedEntryContextProvider.tsx@@ -249,8 +249,8 @@ export const OpenedEntryContextProvider = ({action.action === 'bgdImgChange' ||action.action === 'autoSaveChange' ||(action.action === 'descriptionChange' &&- currentEntry.current.meta.description !==- action.entry.meta.description)+ currentEntry.current.meta?.description !==+ action.entry.meta?.description)) {currentEntry.current = {...currentEntry.current,diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.jsindex 84806c94f..999579922 100644--- a/tests/e2e/general.helpers.js+++ b/tests/e2e/general.helpers.js@@ -1010,14 +1010,18 @@ export async function addDescription(desc) {} catch (e) {await editor.type(desc);}- await expectElementExist('[data-tid=descriptionChangedTID]', true, 8000);+ if (await isDisplayed('[data-tid=descriptionChangedTID]', true, 8000)) {+ await clickOn('[data-tid=saveDescriptionTID]');+ } else {+ await clickOn('[data-tid=saveDescriptionTID]');+ }+ // await expectElementExist('[data-tid=descriptionChangedTID]', true, 8000);/*// editorContent is empty on webconst editorContent = await editor.innerText();await expect(editorContent).toBe(desc);*/// await global.client.waitForTimeout(80000);- await clickOn('[data-tid=saveDescriptionTID]');}export async function createFile(