Simplified 'Liked'

This commit is contained in:
bytedream 2022-06-23 17:00:46 +02:00
parent 0521895f11
commit 4cfcc11e20

View file

@ -145,12 +145,7 @@ func (c *Comment) Like() error {
// Liked returns if the user has liked the comment. // Liked returns if the user has liked the comment.
func (c *Comment) Liked() bool { func (c *Comment) Liked() bool {
for _, flag := range c.Flags { return c.markedAs("liked")
if flag == "liked" {
return true
}
}
return false
} }
// RemoveLike removes the like from the comment. Works only if the user has liked it. // RemoveLike removes the like from the comment. Works only if the user has liked it.