mirror of
https://github.com/coleam00/bolt.new-any-llm
synced 2024-12-27 22:33:03 +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 title = useStore(description);
|
||||
useEffect(() => {
|
||||
workbenchStore.setReloadedMessages(initialMessages.map((m) => m.id));
|
||||
}, [initialMessages]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -39,6 +39,8 @@ export class WorkbenchStore {
|
||||
#editorStore = new EditorStore(this.#filesStore);
|
||||
#terminalStore = new TerminalStore(webcontainer);
|
||||
|
||||
#reloadedMessages = new Set<string>();
|
||||
|
||||
artifacts: Artifacts = import.meta.hot?.data.artifacts ?? map({});
|
||||
|
||||
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?
|
||||
}
|
||||
|
||||
setReloadedMessages(messages: string[]) {
|
||||
this.#reloadedMessages = new Set(messages);
|
||||
}
|
||||
|
||||
addArtifact({ messageId, title, id, type }: ArtifactCallbackData) {
|
||||
const artifact = this.#getArtifact(messageId);
|
||||
|
||||
@ -262,7 +268,13 @@ export class WorkbenchStore {
|
||||
runner: new ActionRunner(
|
||||
webcontainer,
|
||||
() => 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