diff --git a/src/views/admin/components/modals/exposers-modal.vue b/src/views/admin/components/modals/exposers-modal.vue index 2925e8143..390895cd1 100644 --- a/src/views/admin/components/modals/exposers-modal.vue +++ b/src/views/admin/components/modals/exposers-modal.vue @@ -276,7 +276,7 @@ export default { return this.selectedItems && this.selectedItems.length ? 1 : Math.ceil(Number(this.totalItems)/Number(this.maxItemsPerPage)); }, exposerBaseURL() { - let baseURL = this.collectionId != undefined ? '/collection/' + this.collectionId + '/items/' : '/items/'; + let baseURL = this.collectionId ? '/collection/' + this.collectionId + '/items/' : '/items/'; let currentParams = JSON.parse(JSON.stringify(this.$route.query)); // Removes Fetch Only diff --git a/src/views/theme-search/js/view-modes-mixin.js b/src/views/theme-search/js/view-modes-mixin.js index 3aa127243..d746fa02c 100644 --- a/src/views/theme-search/js/view-modes-mixin.js +++ b/src/views/theme-search/js/view-modes-mixin.js @@ -32,7 +32,7 @@ export const viewModesMixin = { } }, mounted() { - this.isSlideshowViewModeEnabled = this.enabledViewModes.findIndex((viewMode) => viewMode == 'slideshow') >= 0; + this.isSlideshowViewModeEnabled = (this.enabledViewModes && Array.isArray(this.enabledViewModes)) ? (this.enabledViewModes.findIndex((viewMode) => viewMode == 'slideshow') >= 0) : false; }, methods: { getItemLink(itemUrl, index) { diff --git a/src/views/theme-search/pages/theme-items-page.vue b/src/views/theme-search/pages/theme-items-page.vue index 31c9258d7..7c40a20fe 100644 --- a/src/views/theme-search/pages/theme-items-page.vue +++ b/src/views/theme-search/pages/theme-items-page.vue @@ -775,7 +775,7 @@ const userPrefViewMode = this.$userPrefs.get(prefsViewMode); let existingViewModeIndex = Object.keys(this.registeredViewModes).findIndex(viewMode => viewMode == userPrefViewMode); - let enabledViewModeIndex = this.enabledViewModes.findIndex((viewMode) => viewMode == userPrefViewMode); + let enabledViewModeIndex = (this.enabledViewModes && Array.isArray(this.enabledViewModes)) ? this.enabledViewModes.findIndex((viewMode) => viewMode == userPrefViewMode) : -1; if (existingViewModeIndex >= 0 && enabledViewModeIndex >= 0) this.$eventBusSearch.setInitialViewMode(userPrefViewMode); else