Fix 'Add to Watchlist' dropdown button. #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If I go and change the status in the watch page of that 'Add to Watchlist' button, go to another page, go back to watching the same anime, then that 'Remove from Watchlist' button has disappeared.
Originally posted by @mkelvers in #1 (comment)
Resolved the problem. BuildWatchData never included "WatchlistIDs" in the template data map. The template guards initWatchlist() behind {{if .WatchlistIDs}}, so the watchlist ID set was never populated on the watch page. The DOMContentLoaded handler then checked an empty set, always returned false, and the remove button stayed hidden. Fix: populate and pass watchlistIDs alongside watchlistStatus.