DEV: Add revert button in diff modal (#246)
This commit is contained in:
parent
9242da545e
commit
99ee949b33
|
@ -35,7 +35,11 @@ export default class ModalDiffModal extends Component {
|
|||
@action={{this.triggerConfirmChanges}}
|
||||
@label="discourse_ai.ai_helper.context_menu.confirm"
|
||||
/>
|
||||
<DModalCancel @close={{@closeModal}} />
|
||||
<DButton
|
||||
class="btn-flat"
|
||||
@action={{this.triggerRevertChanges}}
|
||||
@label="discourse_ai.ai_helper.context_menu.revert"
|
||||
/>
|
||||
</:footer>
|
||||
</DModal>
|
||||
</template>
|
||||
|
@ -45,4 +49,10 @@ export default class ModalDiffModal extends Component {
|
|||
this.args.closeModal();
|
||||
this.args.confirm();
|
||||
}
|
||||
|
||||
@action
|
||||
triggerRevertChanges() {
|
||||
this.args.closeModal();
|
||||
this.args.revert();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
@diff={{this.diff}}
|
||||
@oldValue={{this.selectedText}}
|
||||
@newValue={{this.newSelectedText}}
|
||||
@revert={{this.undoAIAction}}
|
||||
@closeModal={{fn (mut this.showDiffModal) false}}
|
||||
/>
|
||||
{{/if}}
|
Loading…
Reference in New Issue