From 657454f40baf5917f525f3920c49782b7fc0546e Mon Sep 17 00:00:00 2001 From: kilo Date: Sun, 29 Oct 2017 19:17:55 +0100 Subject: [PATCH] Update view.go --- controllers/torrent/view.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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