Skip to content

Commit

Permalink
fix(external-store): add initial messages to message repository (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Jul 29, 2024
1 parent fc081fb commit 0302235
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-jokes-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@assistant-ui/react": patch
---

fix(external-store): add initial messages to message repository
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ export class ExternalStoreThreadRuntime implements ReactThreadRuntime {
};
}

public messages;
public isDisabled;
public isRunning;
public messages: ThreadMessage[] = [];
public isDisabled = false;
public isRunning = false;

constructor(public store: ExternalStoreAdapter<any>) {
this.isDisabled = store.isDisabled ?? false;
this.isRunning = store.isRunning ?? false;
this.messages = store.messages;
this.updateData(
store.isDisabled ?? false,
store.isRunning ?? false,
store.messages,
);

this.useStore = create(() => ({
store,
Expand Down

0 comments on commit 0302235

Please sign in to comment.