2018-04-02 07:34:16 +02:00
|
|
|
import AnimeNotifier from "../AnimeNotifier"
|
2017-10-17 11:27:15 +02:00
|
|
|
|
|
|
|
// Follow user
|
|
|
|
export function followUser(arn: AnimeNotifier, elem: HTMLElement) {
|
2018-04-25 18:59:23 +02:00
|
|
|
return arn.post(elem.dataset.api)
|
2017-10-17 11:27:15 +02:00
|
|
|
.then(() => arn.reloadContent())
|
2018-06-28 15:30:24 +09:00
|
|
|
.then(() => arn.statusMessage.showInfo("You are now following " + document.getElementById("nick").textContent + "."))
|
2017-10-17 11:27:15 +02:00
|
|
|
.catch(err => arn.statusMessage.showError(err))
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unfollow user
|
|
|
|
export function unfollowUser(arn: AnimeNotifier, elem: HTMLElement) {
|
2018-04-25 18:59:23 +02:00
|
|
|
return arn.post(elem.dataset.api)
|
2017-10-17 11:27:15 +02:00
|
|
|
.then(() => arn.reloadContent())
|
2018-06-28 15:30:24 +09:00
|
|
|
.then(() => arn.statusMessage.showInfo("You stopped following " + document.getElementById("nick").textContent + "."))
|
2017-10-17 11:27:15 +02:00
|
|
|
.catch(err => arn.statusMessage.showError(err))
|
|
|
|
}
|