Skip to content

Commit

Permalink
wip settings
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Nov 6, 2024
1 parent dfb2777 commit ba75baa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
15 changes: 11 additions & 4 deletions src/aipane/components/Aipane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ const Aipane: React.FC<AipaneProps> = (props: AipaneProps): React.JSX.Element =>
*/
const [showApiKeyInput, setShowApiKeyInput] = useState(false);

/**
* @state isOutlook
* @description Whether the application is running in Outlook.
*/
const [isOutlook, setIsOutlook] = useState(false);

/**
* @constant listItems
* @description The list items are static and won't change at runtime,
Expand Down Expand Up @@ -179,9 +185,10 @@ const Aipane: React.FC<AipaneProps> = (props: AipaneProps): React.JSX.Element =>

// Show the version number, the build date and the target use in the console
// eslint-disable-next-line no-console
isOutlookClient().then((isOutlook) =>
console.log(`Version: ${versionInfo.commit} Date: ${versionInfo.date} Runs on Outlook: ${isOutlook}`)
);
isOutlookClient().then((isOutlook) => {
setIsOutlook(isOutlook);
console.log(`Version: ${versionInfo.commit} Date: ${versionInfo.date} Runs on Outlook: ${isOutlook}`);
});

return (
<div className={styles.root}>
Expand All @@ -202,7 +209,7 @@ const Aipane: React.FC<AipaneProps> = (props: AipaneProps): React.JSX.Element =>
<TextInsertion getAIAnswer={handlePromptSubmit} basePrompt={""} />
</>
)}
<Link to="settings">Settings</Link>
{isOutlook ? <p>Clean the keys</p> : <Link to="settings">Settings</Link>}
</div>
);
};
Expand Down
6 changes: 1 addition & 5 deletions src/aipane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ const router = createBrowserRouter(
element: <AIPane title={title} />,
},
{
path: "/aipane",
element: <AIPane title={title} />,
},
{
path: "settings",
path: "/settings",
element: <Settings />,
},
],
Expand Down
4 changes: 2 additions & 2 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const versionInfo = {
commit: "7881d27792794d6b25ff08c56e77f1a13a4261e2",
date: "2024-11-06 09:18:41 +0100",
commit: "dfb277738af7395fc15bd56c29e4a5f6c943ec3f",
date: "2024-11-06 10:03:56 +0100",
};

0 comments on commit ba75baa

Please sign in to comment.