Add visual indicator while recipe loads (#4447)
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
} from '../components/ConfigContext';
|
} from '../components/ConfigContext';
|
||||||
import { backupConfig, initConfig, readAllConfig, recoverConfig, validateConfig } from '../api';
|
import { backupConfig, initConfig, readAllConfig, recoverConfig, validateConfig } from '../api';
|
||||||
import { COST_TRACKING_ENABLED } from '../updates';
|
import { COST_TRACKING_ENABLED } from '../updates';
|
||||||
|
import { toastService } from '../toasts';
|
||||||
|
|
||||||
interface InitializationDependencies {
|
interface InitializationDependencies {
|
||||||
getExtensions?: (b: boolean) => Promise<FixedExtensionEntry[]>;
|
getExtensions?: (b: boolean) => Promise<FixedExtensionEntry[]>;
|
||||||
@@ -156,6 +157,13 @@ const initializeForRecipe = async ({
|
|||||||
> & {
|
> & {
|
||||||
recipeConfig: Recipe;
|
recipeConfig: Recipe;
|
||||||
}) => {
|
}) => {
|
||||||
|
toastService.configure({ silent: false });
|
||||||
|
|
||||||
|
const loadingToastId = toastService.loading({
|
||||||
|
title: `Loading recipe: ${recipeConfig.title}`,
|
||||||
|
msg: 'Setting up environment...',
|
||||||
|
});
|
||||||
|
|
||||||
await initConfig();
|
await initConfig();
|
||||||
await readAllConfig({ throwOnError: true });
|
await readAllConfig({ throwOnError: true });
|
||||||
|
|
||||||
@@ -165,6 +173,9 @@ const initializeForRecipe = async ({
|
|||||||
setIsExtensionsLoading,
|
setIsExtensionsLoading,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
toastService.dismiss(loadingToastId);
|
||||||
|
toastService.success({ title: 'Recipe loaded', msg: `Recipe is ready to use` });
|
||||||
|
|
||||||
setPairChat((prevChat) => ({
|
setPairChat((prevChat) => ({
|
||||||
...prevChat,
|
...prevChat,
|
||||||
recipeConfig: recipeConfig,
|
recipeConfig: recipeConfig,
|
||||||
|
|||||||
Reference in New Issue
Block a user