mirror of
https://github.com/Luzifer/twitch-manager.git
synced 2024-12-30 08:31:18 +00:00
Fix: Show follow alert after follower was cleared
This commit is contained in:
parent
11e898ab99
commit
79fd31ec4e
1 changed files with 5 additions and 3 deletions
|
@ -38,6 +38,7 @@ const app = new Vue({
|
||||||
avail: false,
|
avail: false,
|
||||||
backoff: 100,
|
backoff: 100,
|
||||||
},
|
},
|
||||||
|
firstLoad: true,
|
||||||
sound: null,
|
sound: null,
|
||||||
store: {},
|
store: {},
|
||||||
socket: null,
|
socket: null,
|
||||||
|
@ -92,6 +93,7 @@ const app = new Vue({
|
||||||
|
|
||||||
case 'store':
|
case 'store':
|
||||||
this.store = data.payload
|
this.store = data.payload
|
||||||
|
window.setTimeout(() => { this.firstLoad = false }, 100) // Delayed to let the watches trigger
|
||||||
break
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -107,11 +109,11 @@ const app = new Vue({
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'store.followers.last'(to, from) {
|
'store.followers.last'(to, from) {
|
||||||
if (!from || !to) {
|
if (this.firstLoad || !to) {
|
||||||
// Initial load
|
// Initial load or no follower
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.showAlert('New Follower', `${to} just followed`)
|
this.showAlert('New Follower', `${to} just followed`, 'success')
|
||||||
this.playSound('/public/doorbell.webm')
|
this.playSound('/public/doorbell.webm')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue