Cleanup storage code

This allows us to use either session or local storage, for issue #120.
This commit is contained in:
N-Pex 2021-05-10 11:13:22 +02:00
parent af04dd39f7
commit 0ac3cefb03
9 changed files with 144 additions and 89 deletions

View file

@ -60,6 +60,7 @@
<div class="ml-2">{{ data.item.name }}</div>
</template>
</v-select>
<v-switch v-model="sharedComputer" label="Using a shared computer" />
</v-col>
</v-row>
<v-row v-else>
@ -200,6 +201,14 @@ export default {
.substring(0, 1)
.toUpperCase();
},
sharedComputer: {
get: function () {
return !this.$store.state.useLocalStorage;
},
set: function (sharedComputer) {
this.$store.commit('setUseLocalStorage', !sharedComputer);
},
}
},
watch: {
roomId: {
@ -264,7 +273,7 @@ export default {
if (this.$matrix.ready) {
return Promise.resolve(this.$matrix.currentUser);
}
return this.$store.dispatch("auth/login", this.currentUser || this.guestUser);
return this.$store.dispatch("login", this.currentUser || this.guestUser);
},
getRoomInfo() {