Monorepo for Tangled tangled.org

appview/pages: don't access `MultiAccountUser.Active` from template

We are using `MultiAccountUser.Did()` to get current DID instead.

Signed-off-by: Seongmin Lee <git@boltless.me>

boltless.me 48587e58 978dfbde

verified
+7 -8
+7 -8
appview/pages/templates/layouts/fragments/topbar.html
··· 43 43 {{ end }} 44 44 45 45 {{ define "profileDropdown" }} 46 + {{ $handle := resolve .Did }} 46 47 <details class="relative inline-block text-left nav-dropdown"> 47 48 <summary class="cursor-pointer list-none flex items-center gap-1"> 48 - {{ $user := .Active.Did }} 49 - {{ template "user/fragments/pic" (list $user "size-6") }} 50 - <span class="hidden md:inline">{{ $user | resolve | truncateAt30 }}</span> 49 + {{ template "user/fragments/pic" (list .Did "size-6") }} 50 + <span class="hidden md:inline">{{ $handle | truncateAt30 }}</span> 51 51 </summary> 52 52 <div class="absolute right-0 mt-4 rounded bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700 shadow-lg z-50 text-sm" style="width: 14rem;"> 53 - {{ $active := .Active.Did }} 54 53 {{ $linkStyle := "flex items-center gap-3 px-4 py-2 hover:no-underline hover:bg-gray-50 hover:dark:bg-gray-700/50" }} 55 54 56 - {{ $others := .Accounts | otherAccounts $active }} 55 + {{ $others := .Accounts | otherAccounts .Did }} 57 56 {{ if $others }} 58 57 <div class="text-sm text-gray-500 dark:text-gray-400 px-3 py-1 pt-2">switch account</div> 59 58 {{ range $others }} ··· 81 80 </a> 82 81 83 82 <div class="border-t border-gray-200 dark:border-gray-700"> 84 - <a href="/{{ $active }}" class="{{$linkStyle}}"> 83 + <a href="/{{ $handle }}" class="{{$linkStyle}}"> 85 84 {{ i "user" "size-4" }} 86 85 profile 87 86 </a> 88 - <a href="/{{ $active }}?tab=repos" class="{{$linkStyle}}"> 87 + <a href="/{{ $handle }}?tab=repos" class="{{$linkStyle}}"> 89 88 {{ i "book-marked" "size-4" }} 90 89 repositories 91 90 </a> 92 - <a href="/{{ $active }}?tab=strings" class="{{$linkStyle}}"> 91 + <a href="/{{ $handle }}?tab=strings" class="{{$linkStyle}}"> 93 92 {{ i "line-squiggle" "size-4" }} 94 93 strings 95 94 </a>