π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
:rotating_light: Adds null check for appConfig
Alicia Sykesa95c91a3809d
diff --git a/src/components/Settings/SettingsContainer.vue b/src/components/Settings/SettingsContainer.vueindex 79914598..e3e2e4d6 100644--- a/src/components/Settings/SettingsContainer.vue+++ b/src/components/Settings/SettingsContainer.vue@@ -1,6 +1,5 @@<template><section>- <p>{{ getUserState }}</p><SearchBar ref="SearchBar"@user-is-searchin="userIsTypingSomething"v-if="searchVisible"@@ -14,7 +13,7 @@<ItemSizeSelector :iconSize="iconSize" @iconSizeUpdated="updateIconSize" /><ConfigLauncher :sections="sections" :pageInfo="pageInfo" :appConfig="appConfig"@modalChanged="modalChanged" />- <AuthButtons v-if="getUserState != 'noone'" :userType="getUserState" />+ <AuthButtons v-if="userState != 'noone'" :userType="userState" /></div><div :class="`show-hide-container ${settingsVisible? 'hide-btn' : 'show-btn'}`"><button @click="toggleSettingsVisibility()"@@ -114,8 +113,8 @@ export default {* Note that if auth is enabled, but not guest access, and user not logged in,* then they will never be able to view the homepage, so no button needed*/- getUserState() {- return getUserState(this.appConfig);+ userState() {+ return getUserState(this.appConfig || {});},},data() {diff --git a/src/utils/Auth.js b/src/utils/Auth.jsindex 9086e1f1..269b8e28 100644--- a/src/utils/Auth.js+++ b/src/utils/Auth.js@@ -127,6 +127,6 @@ export const getUserState = (appConfig) => {const users = appConfig.auth || []; // Get auth objectif (!isAuthEnabled(users)) return notConfigured; // No auth enabledif (isLoggedIn(users)) return loggedIn; // User is logged in- if (isGuestAccessEnabled(appConfig || {})) return guestAccess; // Guest is viewing+ if (isGuestAccessEnabled(appConfig)) return guestAccess; // Guest is viewingreturn notConfigured;};