Skip to content

Commit

Permalink
Clarify the load completed tasks button strings
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Apr 17, 2023
1 parent 60ab3ca commit 9bfddd7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/LoadCompletedButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.

<template>
<div v-show="!loadedCompleted"
v-tooltip.auto="t('tasks', 'Loading the completed tasks of all lists might slow down the app.')"
v-tooltip.auto="buttonStrings.tooltip"
class="loadmore reactive">
<NcButton type="tertiary"
@click="loadCompletedTasks">
<template #icon>
<CloudDownload :size="20" />
</template>
{{ calendars.length > 1 ? t('tasks', 'Load completed tasks for all lists.') : t('tasks', 'Load all completed tasks.') }}
{{ buttonStrings.text }}
</NcButton>
</div>
</template>
Expand Down Expand Up @@ -60,6 +60,19 @@ export default {
loadedCompleted() {
return this.calendars.every(calendar => calendar.loadedCompleted)
},
buttonStrings() {
if (this.calendars.length > 1) {
return {
text: t('tasks', 'Load the completed tasks of all lists.'),
tooltip: t('tasks', 'Loading the completed tasks of all lists might slow down the app.'),
}
} else {
return {
text: t('tasks', 'Load the completed tasks of list "{calendar}".', { calendar: this.calendars?.[0]?.displayName }),
tooltip: ('tasks', 'Loading the completed tasks might slow down the app.'),
}
}
},
},
methods: {
t,
Expand Down

0 comments on commit 9bfddd7

Please sign in to comment.