Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): remove inserted citations on cancel #10518

Mergedextoci(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/10518/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 19 additions and 7 deletions.

x
0 of 2 viewed, 2 left
8 additions and 1 deletionapps/web/src/components/chat/AssistantCitationChip.tsxModified
View file
@@ -41,6 +41,7 @@
open: boolean;
sourceAnchor?: AssistantCitationSourceAnchor | undefined;
onOpenChange: (open: boolean) => void;
+ onCancel?: () => void;
onSave: (comment: string) => boolean;
onSaveAndSend?: (comment: string) => boolean;
};
@@ -168,7 +169,13 @@
: {})}
- onCancel={() => commentEditor.onOpenChange(false)}
+ onCancel={() => {
+ if (commentEditor.onCancel) {
+ commentEditor.onCancel();
+ } else {
+ commentEditor.onOpenChange(false);
+ }
+ }}
</PopoverPopup>
) : null}
11 additions and 6 deletionsapps/web/src/components/ComposerCitationNode.tsxModified
View file
@@ -42,6 +42,7 @@
export type ComposerCitationCommentTarget = {