Skip to content

Commit 115b942

Browse files
committed
Add a check to prevent following someone twice
1 parent d3f7c65 commit 115b942

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/routes/follow.nim

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ proc addUserToFollowing*(following, toAdd: string): string =
88
var updated = following.split(",")
99
if updated == @[""]:
1010
return toAdd
11+
elif toAdd in updated:
12+
return following
1113
else:
1214
updated = concat(updated, @[toAdd])
1315
result = updated.join(",")

0 commit comments

Comments
 (0)