mirror of https://github.com/nextcloud/calendar
Merge pull request #1631 from nextcloud/bugfix/noid/do_not_show_calendar_picker_if_only_one_writeable
Hide calendar-picker if user has only one writable calendar
This commit is contained in:
commit
9a8f8bbfd9
|
@ -242,6 +242,19 @@ export default {
|
|||
selectedCalendar() {
|
||||
return this.$store.getters.getCalendarById(this.calendarId)
|
||||
},
|
||||
/**
|
||||
* Returns whether or not to display the calendar-picker
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
showCalendarPicker() {
|
||||
// Always show the calendar's name when we are in a read-only calendar
|
||||
if (this.isReadOnly) {
|
||||
return true
|
||||
}
|
||||
|
||||
return this.$store.getters.sortedCalendars.length > 1
|
||||
},
|
||||
/**
|
||||
* Returns the preferred timezone of the user.
|
||||
* If the timezone is set to automatic, it returns the detected one
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
</div>
|
||||
<div v-if="!isLoading" class="app-sidebar-tab__content">
|
||||
<PropertyCalendarPicker
|
||||
v-if="showCalendarPicker"
|
||||
:calendars="calendars"
|
||||
:calendar="selectedCalendar"
|
||||
:is-read-only="isReadOnly"
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
@toggleAllDay="toggleAllDay" />
|
||||
|
||||
<PropertyCalendarPicker
|
||||
v-if="!isLoading"
|
||||
v-if="!isLoading && showCalendarPicker"
|
||||
:calendars="calendars"
|
||||
:calendar="selectedCalendar"
|
||||
:is-read-only="isReadOnly"
|
||||
|
|
Loading…
Reference in New Issue