updates frontend to use DB api
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<main id="app" class="section">
|
||||
<section id="content" class="columns is-desktop">
|
||||
<Player v-if="fullyLoaded"></Player>
|
||||
<Player v-if="state.initiated"></Player>
|
||||
<div class="column">
|
||||
<Chest :player="0" v-if="fullyLoaded"></Chest>
|
||||
<Chest :player="0" v-if="state.initiated"></Chest>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
@@ -32,14 +32,18 @@ function getCookie(cname) {
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
data () { return {
|
||||
fullyLoaded: false,
|
||||
};},
|
||||
data () {
|
||||
return {
|
||||
state: AppStorage.state,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
Player,
|
||||
Chest
|
||||
},
|
||||
created () {
|
||||
// Initiate with active player set to value found in cookie
|
||||
// or as group by default.
|
||||
const cookie = getCookie("player_id");
|
||||
let playerId;
|
||||
if (cookie == "") {
|
||||
@@ -47,8 +51,7 @@ export default {
|
||||
} else {
|
||||
playerId = Number(cookie);
|
||||
}
|
||||
AppStorage.initStorage(playerId)
|
||||
.then(_ => this.fullyLoaded = true);
|
||||
AppStorage.initStorage(playerId);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user