mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
ignored alert on project reload
This commit is contained in:
parent
975e7d83fd
commit
28f0c3629d
@ -35,6 +35,9 @@ export function Chat() {
|
|||||||
|
|
||||||
const { ready, initialMessages, storeMessageHistory, importChat, exportChat } = useChatHistory();
|
const { ready, initialMessages, storeMessageHistory, importChat, exportChat } = useChatHistory();
|
||||||
const title = useStore(description);
|
const title = useStore(description);
|
||||||
|
useEffect(() => {
|
||||||
|
workbenchStore.setReloadedMessages(initialMessages.map((m) => m.id));
|
||||||
|
}, [initialMessages]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -39,6 +39,8 @@ export class WorkbenchStore {
|
|||||||
#editorStore = new EditorStore(this.#filesStore);
|
#editorStore = new EditorStore(this.#filesStore);
|
||||||
#terminalStore = new TerminalStore(webcontainer);
|
#terminalStore = new TerminalStore(webcontainer);
|
||||||
|
|
||||||
|
#reloadedMessages = new Set<string>();
|
||||||
|
|
||||||
artifacts: Artifacts = import.meta.hot?.data.artifacts ?? map({});
|
artifacts: Artifacts = import.meta.hot?.data.artifacts ?? map({});
|
||||||
|
|
||||||
showWorkbench: WritableAtom<boolean> = import.meta.hot?.data.showWorkbench ?? atom(false);
|
showWorkbench: WritableAtom<boolean> = import.meta.hot?.data.showWorkbench ?? atom(false);
|
||||||
@ -243,6 +245,10 @@ export class WorkbenchStore {
|
|||||||
// TODO: what do we wanna do and how do we wanna recover from this?
|
// TODO: what do we wanna do and how do we wanna recover from this?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setReloadedMessages(messages: string[]) {
|
||||||
|
this.#reloadedMessages = new Set(messages);
|
||||||
|
}
|
||||||
|
|
||||||
addArtifact({ messageId, title, id, type }: ArtifactCallbackData) {
|
addArtifact({ messageId, title, id, type }: ArtifactCallbackData) {
|
||||||
const artifact = this.#getArtifact(messageId);
|
const artifact = this.#getArtifact(messageId);
|
||||||
|
|
||||||
@ -262,7 +268,13 @@ export class WorkbenchStore {
|
|||||||
runner: new ActionRunner(
|
runner: new ActionRunner(
|
||||||
webcontainer,
|
webcontainer,
|
||||||
() => this.boltTerminal,
|
() => this.boltTerminal,
|
||||||
(alert) => this.actionAlert.set(alert),
|
(alert) => {
|
||||||
|
if (this.#reloadedMessages.has(messageId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.actionAlert.set(alert);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user