oisgeht
This commit is contained in:
parent
3b034edc52
commit
3e8b9e141d
2 changed files with 8 additions and 6 deletions
|
|
@ -51,6 +51,7 @@ export default defineComponent({
|
||||||
userScores: {},
|
userScores: {},
|
||||||
userId: -1,
|
userId: -1,
|
||||||
user: null as User | null,
|
user: null as User | null,
|
||||||
|
leaderboardEvent: new Event('reloadLeaderboard')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -73,8 +74,7 @@ export default defineComponent({
|
||||||
this.userId = user.id ?? -1;
|
this.userId = user.id ?? -1;
|
||||||
await this.updateUserScores();
|
await this.updateUserScores();
|
||||||
}
|
}
|
||||||
let reloadEvent = new Event('reloadLeaderboard');
|
window.dispatchEvent(this.leaderboardEvent);
|
||||||
window.dispatchEvent(reloadEvent);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
<RRButton @click="nextPage" text=">"></RRButton>
|
<RRButton @click="nextPage" text=">"></RRButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" v-for="entry in this.page" :key="entry.rank" >
|
<div class="row" v-for="entry in this.page" :key="entry.rank">
|
||||||
<LeaderboardEntry :entry="entry" ></LeaderboardEntry>
|
<LeaderboardEntry :entry="entry"></LeaderboardEntry>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -35,11 +35,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
type: "totalplaytime" | "highscore",
|
type: "totalplaytime" | "highscore",
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.updatePage();
|
this.updatePage();
|
||||||
window.addEventListener('reloadLeaderboard', () => {this.updatePage()}, false)
|
window.addEventListener('itemInserted', () => {
|
||||||
|
this.updatePage();
|
||||||
|
}, false)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchPage() {
|
async fetchPage() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue