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: {},
|
||||
userId: -1,
|
||||
user: null as User | null,
|
||||
leaderboardEvent: new Event('reloadLeaderboard')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -73,8 +74,7 @@ export default defineComponent({
|
|||
this.userId = user.id ?? -1;
|
||||
await this.updateUserScores();
|
||||
}
|
||||
let reloadEvent = new Event('reloadLeaderboard');
|
||||
window.dispatchEvent(reloadEvent);
|
||||
window.dispatchEvent(this.leaderboardEvent);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
<RRButton @click="nextPage" text=">"></RRButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-for="entry in this.page" :key="entry.rank" >
|
||||
<LeaderboardEntry :entry="entry" ></LeaderboardEntry>
|
||||
<div class="row" v-for="entry in this.page" :key="entry.rank">
|
||||
<LeaderboardEntry :entry="entry"></LeaderboardEntry>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -35,11 +35,13 @@ export default {
|
|||
}
|
||||
},
|
||||
props: {
|
||||
type: "totalplaytime" | "highscore",
|
||||
type: "totalplaytime" | "highscore",
|
||||
},
|
||||
created() {
|
||||
this.updatePage();
|
||||
window.addEventListener('reloadLeaderboard', () => {this.updatePage()}, false)
|
||||
window.addEventListener('itemInserted', () => {
|
||||
this.updatePage();
|
||||
}, false)
|
||||
},
|
||||
methods: {
|
||||
async fetchPage() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue