Don't hide all lists of namespaces when loosing network connectivity

This commit is contained in:
kolaente 2021-04-19 22:36:31 +02:00
parent 2d4ea80c90
commit 1a03c035f0
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<template v-if="online"> <div :class="{'is-hidden': !online}">
<!-- This is a workaround to get the sw to "see" the to-be-cached version of the offline background image --> <!-- This is a workaround to get the sw to "see" the to-be-cached version of the offline background image -->
<div class="offline" style="height: 0;width: 0;"></div> <div class="offline" style="height: 0;width: 0;"></div>
<top-navigation v-if="authUser"/> <top-navigation v-if="authUser"/>
@ -8,8 +8,8 @@
<content-link-share v-else-if="authLinkShare"/> <content-link-share v-else-if="authLinkShare"/>
<content-no-auth v-else/> <content-no-auth v-else/>
<notification/> <notification/>
</template> </div>
<div class="app offline" v-else> <div class="app offline" v-if="!online">
<div class="offline-message"> <div class="offline-message">
<h1>You are offline.</h1> <h1>You are offline.</h1>
<p>Please check your network connection and try again.</p> <p>Please check your network connection and try again.</p>

View file

@ -66,7 +66,7 @@
</span> </span>
<namespace-settings-dropdown :namespace="n" v-if="n.id > 0"/> <namespace-settings-dropdown :namespace="n" v-if="n.id > 0"/>
</div> </div>
<div :key="n.id + 'child'" class="more-container" v-if="listsVisible[n.id]"> <div :key="n.id + 'child'" class="more-container" v-if="typeof listsVisible[n.id] !== 'undefined' ? listsVisible[n.id] : true">
<ul class="menu-list can-be-hidden"> <ul class="menu-list can-be-hidden">
<template v-for="l in n.lists"> <template v-for="l in n.lists">
<!-- This is a bit ugly but vue wouldn't want to let me filter this - probably because the lists <!-- This is a bit ugly but vue wouldn't want to let me filter this - probably because the lists
@ -142,7 +142,9 @@ export default {
this.$store.dispatch('namespaces/loadNamespaces') this.$store.dispatch('namespaces/loadNamespaces')
.then(namespaces => { .then(namespaces => {
namespaces.forEach(n => { namespaces.forEach(n => {
this.$set(this.listsVisible, n.id, true) if (typeof this.listsVisible[n.id] === 'undefined') {
this.$set(this.listsVisible, n.id, true)
}
}) })
}) })
}, },