diff --git a/src/components/UserAggregationList/index.tsx b/src/components/UserAggregationList/index.tsx
index 81eb6df..1aa2e0f 100644
--- a/src/components/UserAggregationList/index.tsx
+++ b/src/components/UserAggregationList/index.tsx
@@ -434,6 +434,7 @@ function UserAggregationItem({
const { t } = useTranslation()
const supportTouch = useMemo(() => isTouchDevice(), [])
const [hasNewEvents, setHasNewEvents] = useState(true)
+ const [loading, setLoading] = useState(false)
const { isPinned, togglePin } = usePinnedUsers()
useEffect(() => {
@@ -457,7 +458,10 @@ function UserAggregationItem({
const onTogglePin = (e: React.MouseEvent) => {
e.stopPropagation()
- togglePin(aggregation.pubkey)
+ setLoading(true)
+ togglePin(aggregation.pubkey).finally(() => {
+ setLoading(false)
+ })
}
const onToggleViewed = (e: React.MouseEvent) => {
@@ -520,10 +524,12 @@ function UserAggregationItem({
}`}
title={isPinned(aggregation.pubkey) ? t('Unpin') : t('Pin')}
>
- {isPinned(aggregation.pubkey) ? (
-
+ {loading ? (
+
+ ) : isPinned(aggregation.pubkey) ? (
+
) : (
-
+
)}