1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

vueui: check current snapshot first when using its props

This commit is contained in:
Ivan Velev 2021-09-28 00:56:54 -07:00
parent 2ac83c61fd
commit fa317deeb4
2 changed files with 11 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
<div class="list">
<div v-for="period in snapshotPeriods">
<span class="link" @click="gotoPeriod(period)" >{{period.snapshot.getTimeFormatted()}}</span>
<span v-if="currentSnapshot.id === period.snapshot.id" class="current">current</span>
<span v-if="isCurrentSnapshot(period)" class="current">current</span>
</div>
</div>
</div>
@ -30,6 +30,9 @@ export default {
methods: {
gotoPeriod(period) {
this.$emit('goto-period', period);
},
isCurrentSnapshot(period) {
return this.currentSnapshot && this.currentSnapshot.id === period.snapshot.id;
}
}
}