Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Seongmin Lee and committed by
Tangled
40e7df13 186efee7

+7 -8
+7 -8
appview/pages/templates/layouts/fragments/topbar.html
··· 48 48 {{ end }} 49 49 50 50 {{ define "profileDropdown" }} 51 + {{ $handle := resolve .Did }} 51 52 <details class="relative inline-block text-left nav-dropdown"> 52 53 <summary class="cursor-pointer list-none flex items-center gap-1"> 53 - {{ $user := .Active.Did }} 54 - {{ template "user/fragments/pic" (list $user "size-6") }} 55 - <span class="hidden md:inline">{{ $user | resolve | truncateAt30 }}</span> 54 + {{ template "user/fragments/pic" (list .Did "size-6") }} 55 + <span class="hidden md:inline">{{ $handle | truncateAt30 }}</span> 56 56 </summary> 57 57 <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;"> 58 - {{ $active := .Active.Did }} 59 58 {{ $linkStyle := "flex items-center gap-3 px-4 py-2 hover:no-underline hover:bg-gray-50 hover:dark:bg-gray-700/50" }} 60 59 61 - {{ $others := .Accounts | otherAccounts $active }} 60 + {{ $others := .Accounts | otherAccounts .Did }} 62 61 {{ if $others }} 63 62 <div class="text-sm text-gray-500 dark:text-gray-400 px-3 py-1 pt-2">switch account</div> 64 63 {{ range $others }} ··· 86 85 </a> 87 86 88 87 <div class="border-t border-gray-200 dark:border-gray-700"> 89 - <a href="/{{ $active }}" class="{{$linkStyle}}"> 88 + <a href="/{{ $handle }}" class="{{$linkStyle}}"> 90 89 {{ i "user" "size-4" }} 91 90 profile 92 91 </a> 93 - <a href="/{{ $active }}?tab=repos" class="{{$linkStyle}}"> 92 + <a href="/{{ $handle }}?tab=repos" class="{{$linkStyle}}"> 94 93 {{ i "book-marked" "size-4" }} 95 94 repositories 96 95 </a> 97 - <a href="/{{ $active }}?tab=strings" class="{{$linkStyle}}"> 96 + <a href="/{{ $handle }}?tab=strings" class="{{$linkStyle}}"> 98 97 {{ i "line-squiggle" "size-4" }} 99 98 strings 100 99 </a>