We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2a1a03 commit 9368cfcCopy full SHA for 9368cfc
routers/user/profile.go
@@ -235,8 +235,17 @@ func Profile(ctx *context.Context) {
235
}
236
237
238
- ctx.Data["ShowUserEmail"] = (len(ctxUser.Email) > 0 && ctx.IsSigned && !ctxUser.KeepEmailPrivate) ||
239
- ctxUser.ID == ctx.User.ID // Show email if the authenticated user owns the profile being viewed
+ var showEmail bool
+
240
+ if len(ctxUser.Email) > 0 && ctx.IsSigned && !ctxUser.KeepEmailPrivate {
241
+ showEmail = true
242
+ } else if ctx.IsSigned {
243
+ // Show email if the authenticated user owns the profile
244
+ // being viewed
245
+ showEmail = ctxUser.ID == ctx.User.ID
246
+ }
247
248
+ ctx.Data["ShowUserEmail"] = showEmail
249
250
ctx.HTML(200, tplProfile)
251
0 commit comments