UX: Hide suggest edit button in fast edit when triggering from AI (#364)

This commit is contained in:
Keegan George 2023-12-15 15:19:04 -08:00 committed by GitHub
parent 19a2949914
commit ba09582d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 13 deletions

View File

@ -24,11 +24,7 @@ export default class AiEditSuggestionButton extends Component {
}
get disabled() {
return (
this.loading ||
this.suggestion?.length > 0 ||
this.args.outletArgs.newValue
);
return this.loading || this.suggestion?.length > 0;
}
async loadMode() {
@ -68,13 +64,15 @@ export default class AiEditSuggestionButton extends Component {
}
<template>
<DButton
class="btn-small btn-ai-suggest-edit"
@action={{this.suggest}}
@icon="discourse-sparkles"
@label="discourse_ai.ai_helper.fast_edit.suggest_button"
@isLoading={{this.loading}}
@disabled={{this.disabled}}
/>
{{#unless @outletArgs.newValue}}
<DButton
class="btn-small btn-ai-suggest-edit"
@action={{this.suggest}}
@icon="discourse-sparkles"
@label="discourse_ai.ai_helper.fast_edit.suggest_button"
@isLoading={{this.loading}}
@disabled={{this.disabled}}
/>
{{/unless}}
</template>
}