diff --git a/controllers/torrent/view.go b/controllers/torrent/view.go index 10934956..e32cbed2 100644 --- a/controllers/torrent/view.go +++ b/controllers/torrent/view.go @@ -40,9 +40,9 @@ func ViewHandler(c *gin.Context) { // Retrieve the torrent torrent, err := torrents.FindByID(uint(id)) - // If come from notification, toggle the notification as read - if c.Request.URL.Query()["notif"] != nil && user.ID > 0 { - notifications.ToggleReadNotification(torrent.Identifier(), user.ID) + // Toggle the notifications related to this torrent as read + if user.ID > 0 { + notifications.ToggleReadNotification(torrent.Identifier(), user) } // If torrent not found, display 404