From d162946f070c8d5fc444c5e6de69bd554d4693d1 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 14 Mar 2018 22:52:56 +0100 Subject: [PATCH] Fixed view collection link --- pages/animelistitem/animelistitem.pixy | 2 +- scripts/Actions/AnimeList.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/animelistitem/animelistitem.pixy b/pages/animelistitem/animelistitem.pixy index dd94ed6e..125b9692 100644 --- a/pages/animelistitem/animelistitem.pixy +++ b/pages/animelistitem/animelistitem.pixy @@ -27,7 +27,7 @@ component AnimeListItem(viewUser *arn.User, item *arn.AnimeListItem, anime *arn. InputTextArea("Notes", item.Notes, "Notes", "Your notes") .buttons.mountable - a.ajax.button(href="/animelist/" + item.Status) + a.ajax.button(href="/+" + viewUser.Nick + "/animelist/" + item.Status) Icon("list") span View collection a.ajax.button(href=anime.Link()) diff --git a/scripts/Actions/AnimeList.ts b/scripts/Actions/AnimeList.ts index 1b73fdda..144ee075 100644 --- a/scripts/Actions/AnimeList.ts +++ b/scripts/Actions/AnimeList.ts @@ -22,12 +22,16 @@ export async function addAnimeToCollection(arn: AnimeNotifier, button: HTMLButto // Remove anime from collection export function removeAnimeFromCollection(arn: AnimeNotifier, button: HTMLElement) { + if(!confirm("Are you sure you want to remove it from your collection?")) { + return + } + button.innerText = "Removing..." let {animeId, nick} = button.dataset let apiEndpoint = arn.findAPIEndpoint(button) arn.post(apiEndpoint + "/remove/" + animeId, "") - .then(() => arn.app.load("/animelist/" + (arn.app.find("Status") as HTMLSelectElement).value)) + .then(() => arn.app.load(`/+${nick}/animelist/` + (arn.app.find("Status") as HTMLSelectElement).value)) .catch(err => arn.statusMessage.showError(err)) } \ No newline at end of file