diff --git a/frontend/page/view_book.templ b/frontend/page/view_book.templ index 22b9a10..335e2cc 100644 --- a/frontend/page/view_book.templ +++ b/frontend/page/view_book.templ @@ -228,12 +228,12 @@ templ ViewBookPage(user *ds.User, book *ds.Book) { { t.Name } } -if book.Status == ds.EntityStatusApproved || user.IsAdmin { +if book.Status == ds.EntityStatusApproved || user != nil && user.IsAdmin {
@icon.Pencil("mr-1", "w-4", "h-4") Edit ... - if user.IsAdmin { + if user != nil && user.IsAdmin { @icon.Trash("mr-1", "w-4", "h-4") Delete diff --git a/frontend/page/view_book_templ.go b/frontend/page/view_book_templ.go index baf2804..3674d4a 100644 --- a/frontend/page/view_book_templ.go +++ b/frontend/page/view_book_templ.go @@ -309,7 +309,7 @@ func ViewBookPage(user *ds.User, book *ds.Book) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if book.Status == ds.EntityStatusApproved || user.IsAdmin { + if book.Status == ds.EntityStatusApproved || user != nil && user.IsAdmin { templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "