Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fixes for lite

sytolk49ab0751e108
diff --git a/src/renderer/components/dialogs/hooks/AiGenerationDialogContextProvider.tsx b/src/renderer/components/dialogs/hooks/AiGenerationDialogContextProvider.tsx
index 0d4e8f905..b42ea16e5 100644
--- a/src/renderer/components/dialogs/hooks/AiGenerationDialogContextProvider.tsx
+++ b/src/renderer/components/dialogs/hooks/AiGenerationDialogContextProvider.tsx
@@ -16,10 +16,9 @@
*
*/
-import ConfirmDialog from '-/components/dialogs/ConfirmDialog';
import { Pro } from '-/pro';
import React, { createContext, useMemo, useReducer, useRef } from 'react';
-import { useTranslation } from 'react-i18next';
+import { useProTeaserDialogContext } from '-/components/dialogs/hooks/useProTeaserDialogContext';
type AiGenerationDialogContextData = {
openAiGenerationDialog: (optionSelected?: generateOptionType) => void;
@@ -41,16 +40,20 @@ export type generateOptionType = 'tags' | 'summary' | 'analyseImages';
export const AiGenerationDialogContextProvider = ({
children,
}: AiGenerationDialogContextProviderProps) => {
- const { t } = useTranslation();
+ const { openProTeaserDialog } = useProTeaserDialogContext();
const open = useRef<boolean>(false);
const option = useRef<generateOptionType>(undefined);
const AiGenerationDialog = Pro && Pro.UI ? Pro.UI.AiGenerationDialog : false;
const [ignored, forceUpdate] = useReducer((x) => x + 1, 0, undefined);
function openDialog(optionSelected: generateOptionType = undefined) {
- open.current = true;
- option.current = optionSelected;
- forceUpdate();
+ if (AiGenerationDialog) {
+ open.current = true;
+ option.current = optionSelected;
+ forceUpdate();
+ } else {
+ openProTeaserDialog('ai');
+ }
}
function closeDialog() {
@@ -67,19 +70,12 @@ export const AiGenerationDialogContextProvider = ({
return (
<AiGenerationDialogContext.Provider value={context}>
- {AiGenerationDialog ? (
+ {AiGenerationDialog && (
<AiGenerationDialog
open={open.current}
onClose={closeDialog}
option={option.current}
/>
- ) : (
- <ConfirmDialog
- open={true}
- onClose={() => {}}
- title={t('core:thisFunctionalityIsAvailableInPro')}
- confirmCallback={() => {}}
- />
)}
{children}
</AiGenerationDialogContext.Provider>
diff --git a/src/renderer/containers/DialogsRoot.tsx b/src/renderer/containers/DialogsRoot.tsx
index ad0ad1c49..5406b0945 100644
--- a/src/renderer/containers/DialogsRoot.tsx
+++ b/src/renderer/containers/DialogsRoot.tsx
@@ -59,11 +59,11 @@ function DialogsRoot({ children }: DialogsRootProps) {
<LicenseDialogContextProvider>
<ThirdPartyLibsDialogContextProvider>
<AboutDialogContextProvider>
- <AiGenerationDialogContextProvider>
- <OnboardingDialogContextProvider>
- <KeyboardDialogContextProvider>
- <LinkDialogContextProvider>
- <ProTeaserDialogContextProvider>
+ <OnboardingDialogContextProvider>
+ <KeyboardDialogContextProvider>
+ <LinkDialogContextProvider>
+ <ProTeaserDialogContextProvider>
+ <AiGenerationDialogContextProvider>
<SettingsDialogContextProvider>
<ResolveConflictContextProvider>
<DownloadUrlContextProvider>
@@ -71,11 +71,11 @@ function DialogsRoot({ children }: DialogsRootProps) {
</DownloadUrlContextProvider>
</ResolveConflictContextProvider>
</SettingsDialogContextProvider>
- </ProTeaserDialogContextProvider>
- </LinkDialogContextProvider>
- </KeyboardDialogContextProvider>
- </OnboardingDialogContextProvider>
- </AiGenerationDialogContextProvider>
+ </AiGenerationDialogContextProvider>
+ </ProTeaserDialogContextProvider>
+ </LinkDialogContextProvider>
+ </KeyboardDialogContextProvider>
+ </OnboardingDialogContextProvider>
</AboutDialogContextProvider>
</ThirdPartyLibsDialogContextProvider>
</LicenseDialogContextProvider>
diff --git a/src/renderer/content/ProTeaserSlides.tsx b/src/renderer/content/ProTeaserSlides.tsx
index 628efb5db..a94db496c 100644
--- a/src/renderer/content/ProTeaserSlides.tsx
+++ b/src/renderer/content/ProTeaserSlides.tsx
@@ -41,6 +41,7 @@ export const slidesNames = [
'search',
'folderColor',
'enterprise',
+ 'ai',
];
export function getProTeaserSlides(t) {
@@ -301,5 +302,29 @@ export function getProTeaserSlides(t) {
pictureURL: EnterpriseImage,
pictureHeight: 200,
};
+ slidesEN[slidesNames[10]] = {
+ title: 'TagSpaces Pro AI',
+ description: (
+ <>
+ <p>
+ The TagSpaces project is fully supported by its subscribers. We do not
+ rely on advertising or data sharing for revenue, so purchasing a Pro
+ subscription directly supports the ongoing development of our core
+ product, TagSpaces Lite, as well as our browser extensions, which
+ remain free to use.
+ </p>
+ <p>
+ In addition, a Pro subscription unlocks a wide range of valuable
+ features, including advanced search capabilities, unique perspectives
+ for organizing your files and folders, and geo-tagging. Some of these
+ features will be highlighted in the following slides.
+ </p>
+ </>
+ ),
+ ctaURL: Links.links.emailContact,
+ ctaTitle: t('contactUs'),
+ pictureURL: EnterpriseImage,
+ pictureHeight: 200,
+ };
return slidesEN;
}
diff --git a/src/renderer/hooks/ChatProvider.tsx b/src/renderer/hooks/ChatProvider.tsx
index 02ddeaf00..ad96fb11f 100644
--- a/src/renderer/hooks/ChatProvider.tsx
+++ b/src/renderer/hooks/ChatProvider.tsx
@@ -290,7 +290,9 @@ export const ChatContextProvider = ({ children }: ChatContextProviderProps) => {
function getGenerationSettings(
option: generateOptionType = 'tags',
): GenerationSettings {
- const item = localStorage.getItem(Pro.keys.generationSettingsKey);
+ const item = Pro
+ ? localStorage.getItem(Pro.keys.generationSettingsKey)
+ : undefined;
const storedObj = item ? JSON.parse(item) : {};
return {
option: option,
@@ -803,7 +805,7 @@ export const ChatContextProvider = ({ children }: ChatContextProviderProps) => {
}
} else if (mode === 'description') {
if (msg) {
- return TEXT_DESCRIPTION.replace('{input_text}', msg)
+ return TEXT_DESCRIPTION?.replace('{input_text}', msg)
.replace(
'{max_chars}',
generationSettings.current.maxChars
@@ -820,7 +822,7 @@ export const ChatContextProvider = ({ children }: ChatContextProviderProps) => {
if (generationSettings.current.option === 'analyseImages') {
return IMAGE_DESCRIPTION_STRUCTURED;
}
- return IMAGE_DESCRIPTION.replace(
+ return IMAGE_DESCRIPTION?.replace(
'{file_name}',
openedEntry ? openedEntry.name : '',
).replace(