Redefined followed users before following/unfollowing
in case someone has multiple tabs open
This commit is contained in:
parent
7149ff3087
commit
b1490c1e2b
1 changed files with 2 additions and 0 deletions
|
@ -165,6 +165,7 @@ let followed = localStorage.followed ? JSON.parse(localStorage.followed) : []
|
|||
if (followed.includes([[ACCOUNTID]])) {$('#followOff').hide(); $('#followOn').show()}
|
||||
|
||||
$('#followOff').click(function() {
|
||||
followed = localStorage.followed ? JSON.parse(localStorage.followed) : []
|
||||
followed.push([[ACCOUNTID]])
|
||||
localStorage.followed = JSON.stringify(followed)
|
||||
$('#followOff').hide()
|
||||
|
@ -172,6 +173,7 @@ $('#followOff').click(function() {
|
|||
})
|
||||
|
||||
$('#followOn').click(function() {
|
||||
followed = localStorage.followed ? JSON.parse(localStorage.followed) : []
|
||||
localStorage.followed = JSON.stringify(followed.filter(x => x != [[ACCOUNTID]]))
|
||||
$('#followOff').show()
|
||||
$('#followOn').hide()
|
||||
|
|
Loading…
Add table
Reference in a new issue