Skip to content

Commit

Permalink
refactor prompt reading (async)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 28, 2024
1 parent 2b0d75f commit cb3bf66
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/aipane/AIPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function getDefaultModel(provider: AIProvider): AIModel {
/**
* Retrieves the prompts from the configuration.
* return all prompts if the application is in standalone mode.
* @param {boolean} standalone - Indicates if the application is in standalone mode.
* @param {boolean} standalone - Indicates if the application is in standalone mode (true if running outside Outlook).
*/
export function getPrompts(standalone: boolean): AIPrompt[] {
if (!standalone) {
Expand Down
5 changes: 4 additions & 1 deletion src/aipane/components/HeroComboPrompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ const useStyles = makeStyles({

// Filter out standalone prompts if the client is Outlook
// Standalone prompts should be used in standalone mode only
const prompts = getPrompts(!isOutlookClient());
let prompts: AIPrompt[] = [];
isOutlookClient().then((isOutlook: boolean) => {
prompts = getPrompts(!isOutlook);
});

const HeroComboPrompts: React.FC<HeroComboPromptsProps> = ({ onChange }) => {
const styles = useStyles();
Expand Down
4 changes: 2 additions & 2 deletions src/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"commit": "27da446f26078da85106ff90ec681e8c7fda3bd9",
"date": "2024-10-22 11:29:30 +0200"
"commit": "2b0d75f16a8c838e87e7465319c357a9b7ac4224",
"date": "2024-10-28 08:08:55 +0100"
}

0 comments on commit cb3bf66

Please sign in to comment.