mirror of https://github.com/logseq/logseq
fix: broken avatar
parent
f768744380
commit
31a8498e3c
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -15,7 +15,9 @@
|
||||||
[frontend.components.repo :as repo]
|
[frontend.components.repo :as repo]
|
||||||
[frontend.components.search :as search]
|
[frontend.components.search :as search]
|
||||||
[frontend.handler.project :as project-handler]
|
[frontend.handler.project :as project-handler]
|
||||||
[frontend.handler.web.nfs :as nfs]))
|
[frontend.handler.web.nfs :as nfs]
|
||||||
|
[goog.dom :as gdom]
|
||||||
|
[goog.object :as gobj]))
|
||||||
|
|
||||||
(rum/defc logo < rum/reactive
|
(rum/defc logo < rum/reactive
|
||||||
[{:keys [white?]}]
|
[{:keys [white?]}]
|
||||||
|
@ -49,8 +51,11 @@
|
||||||
[:button.max-w-xs.flex.items-center.text-sm.rounded-full.focus:outline-none.focus:shadow-outline.h-7.w-7.ml-2
|
[:button.max-w-xs.flex.items-center.text-sm.rounded-full.focus:outline-none.focus:shadow-outline.h-7.w-7.ml-2
|
||||||
{:on-click toggle-fn}
|
{:on-click toggle-fn}
|
||||||
(if-let [avatar (:avatar me)]
|
(if-let [avatar (:avatar me)]
|
||||||
[:img.h-7.w-7.rounded-full
|
[:img#avatar.h-7.w-7.rounded-full
|
||||||
{:src avatar}]
|
{:src avatar
|
||||||
|
:on-error (fn [this]
|
||||||
|
(let [elem (gdom/getElement "avatar")]
|
||||||
|
(gobj/set elem "src" (config/asset-uri "/static/img/broken-avatar.png"))))}]
|
||||||
[:div.h-7.w-7.rounded-full.bg-base-2.opacity-70.hover:opacity-100 {:style {:padding 1.5}}
|
[:div.h-7.w-7.rounded-full.bg-base-2.opacity-70.hover:opacity-100 {:style {:padding 1.5}}
|
||||||
[:a svg/user]])])
|
[:a svg/user]])])
|
||||||
(let [logged? (:name me)]
|
(let [logged? (:name me)]
|
||||||
|
|
Loading…
Reference in New Issue