Skip to content

Commit

Permalink
refactor: simplify question output of delete selected jobs dialog
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Apr 27, 2024
1 parent a29fe5b commit 05dafca
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/dialogs/HistoryListPanelDeleteSelectedDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
</v-btn>
</template>
<v-card-text>
<p v-if="selectedJobs.length === 1" class="mb-0">
{{ $t('History.DeleteSingleJobQuestion') }}
</p>
<p v-else class="mb-0">
{{ $t('History.DeleteSelectedQuestion', { count: selectedJobs.length }) }}
</p>
<p class="mb-0">{{ question }}</p>
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down Expand Up @@ -46,6 +41,12 @@ export default class HistoryListPanelDeleteSelectedDialog extends Mixins(BaseMix
this.$store.dispatch('gui/saveSettingWithoutUpload', { name: 'view.history.selectedJobs', value: newVal })
}
get question() {
if (this.selectedJobs.length === 1) return this.$t('History.DeleteSingleJobQuestion')
return this.$t('History.DeleteSelectedQuestion', { count: this.selectedJobs.length })
}
closeDialog() {
this.$emit('close')
}
Expand Down

0 comments on commit 05dafca

Please sign in to comment.