From f61560f4100981920ebdd1565aacb02b61f0cac3 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 26 Jan 2022 10:52:39 +0100 Subject: [PATCH] [fix] handle missing user id in bookmark view --- templates/view_bookmark.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/view_bookmark.tpl b/templates/view_bookmark.tpl index 3e2f7de..8daea78 100644 --- a/templates/view_bookmark.tpl +++ b/templates/view_bookmark.tpl @@ -14,14 +14,14 @@

{{ Truncate .Bookmark.URL 100 }}

{{ .Bookmark.Notes }}

+ {{ $uid := 0 }} + {{ if .User }}{{ $uid = .User.ID }}{{ end }} {{ if .Bookmark.Tags }} - {{ $uid := 0 }} - {{ if .User }}{{ $uid = .User.ID }}{{ end }} {{ range .Bookmark.Tags }} {{ .Text }} {{ end }} {{ end }} - {{ block "snapshots" KVData "Snapshots" .Bookmark.Snapshots "IsOwn" (eq .Bookmark.UserID .User.ID ) }}{{ end }} + {{ block "snapshots" KVData "Snapshots" .Bookmark.Snapshots "IsOwn" (eq .Bookmark.UserID $uid ) }}{{ end }} {{ .Bookmark.CreatedAt | ToDate }} {{ if .Bookmark.Public }}Public{{ else }}Private{{ end }} {{ if .User }} {{ if eq .User.ID .Bookmark.UserID }}