Skip to content

Commit a40a9aa

Browse files
authored
Add visual indicator while recipe loads (#4447)
1 parent 4e9c5e3 commit a40a9aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ui/desktop/src/utils/appInitialization.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '../components/ConfigContext';
1010
import { backupConfig, initConfig, readAllConfig, recoverConfig, validateConfig } from '../api';
1111
import { COST_TRACKING_ENABLED } from '../updates';
12+
import { toastService } from '../toasts';
1213

1314
interface InitializationDependencies {
1415
getExtensions?: (b: boolean) => Promise<FixedExtensionEntry[]>;
@@ -156,6 +157,13 @@ const initializeForRecipe = async ({
156157
> & {
157158
recipeConfig: Recipe;
158159
}) => {
160+
toastService.configure({ silent: false });
161+
162+
const loadingToastId = toastService.loading({
163+
title: `Loading recipe: ${recipeConfig.title}`,
164+
msg: 'Setting up environment...',
165+
});
166+
159167
await initConfig();
160168
await readAllConfig({ throwOnError: true });
161169

@@ -165,6 +173,9 @@ const initializeForRecipe = async ({
165173
setIsExtensionsLoading,
166174
});
167175

176+
toastService.dismiss(loadingToastId);
177+
toastService.success({ title: 'Recipe loaded', msg: `Recipe is ready to use` });
178+
168179
setPairChat((prevChat) => ({
169180
...prevChat,
170181
recipeConfig: recipeConfig,

0 commit comments

Comments
 (0)