Skip to content

Commit

Permalink
fix(eventlist): display GET attribute should not be ignored (#4003)
Browse files Browse the repository at this point in the history
Fixes #4002
  • Loading branch information
sogehige committed Jul 27, 2020
1 parent 00de861 commit 1dde835
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/overlay/views/eventlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
:key="event._id"
class="event"
:class="[event.type]">
<strong class="username">{{ event.username }}</strong>
<span class="event">{{ event.summary }}</span>
<template v-for="type of display">
<strong v-if="type === 'username'" class="username" :key="type">{{ event.username }}</strong>
<span v-else class="event" :key="type">{{ event.summary }}</span>
</template>
</li>
</ul>
</template>
Expand All @@ -21,6 +23,8 @@ import { EventListInterface } from '../../bot/database/entity/eventList';
export default class ClipsOverlay extends Vue {
socket = getSocket('/overlays/eventlist', true);
events: any[] = [];
display = ['username', 'event'];
created () {
setTimeout(() => this.refresh(), 1000);
}
Expand All @@ -33,9 +37,9 @@ export default class ClipsOverlay extends Vue {
return console.error(err);
}
var order = (this.urlParam('order') as "desc" | "asc") || 'desc'
var display: string | string[] = this.urlParam('display') || 'username,event'; display = display.split(',')
this.display = this.urlParam('display')?.split(',') || 'username,event'.split(',');
console.debug({order, display})
console.debug({order, display: this.display})
this.events = orderBy(data, 'timestamp', order).map((o) => {
const values = JSON.parse(o.values_json);
if (o.event === 'resub') {
Expand Down Expand Up @@ -104,4 +108,12 @@ export default class ClipsOverlay extends Vue {
ul li:nth-child(5) {
opacity: 0.2;
}
.event {
padding: 0 .2rem;
}
.username {
padding: 0 .2rem;
}
</style>

0 comments on commit 1dde835

Please sign in to comment.