Skip to content

Commit

Permalink
fix: close the active conversation on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
nivthefox committed Nov 13, 2024
1 parent 0e4fd47 commit c9cebfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Resolved an issue where models could be set prematurely. (#1)
- Improved the prompt for text generation.
- Close the active conversation when it is deleted.

## [1.1.0](https://github.com/nivthefox/foundryvtt-aide/releases/tag/1.1.0) - 2024-11-09
### Added
Expand Down
5 changes: 5 additions & 0 deletions src/ui/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ export class Chat extends HandlebarsApplicationMixin(ApplicationV2) {
const userId = target.parentElement.getAttribute('data-user-id');
const id = target.parentElement.getAttribute('data-id');
await this.conversationStore.delete(userId, id);

if (this.#activeConversation && this.#activeConversation.id === id) {
this.#activeConversation = null;
}

await this.render(false);
}

Expand Down

0 comments on commit c9cebfa

Please sign in to comment.