From 272ebbc2baa60de07330d03a2b72cb4e070d1017 Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 15 Jan 2026 21:05:45 +0530 Subject: [PATCH] fix: follow-button-message --- .../src/lib/fragments/Profile/Profile.svelte | 47 ++++++++++++++++++- .../(protected)/profile/[id]/+page.svelte | 7 ++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/platforms/pictique/src/lib/fragments/Profile/Profile.svelte b/platforms/pictique/src/lib/fragments/Profile/Profile.svelte index 8e890c837..f681acc57 100644 --- a/platforms/pictique/src/lib/fragments/Profile/Profile.svelte +++ b/platforms/pictique/src/lib/fragments/Profile/Profile.svelte @@ -1,23 +1,40 @@
@@ -36,7 +53,33 @@
{#if variant === 'other'}
- +
+ +
{/if} diff --git a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte index 06c2c53ae..dba5ae8a2 100644 --- a/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte +++ b/platforms/pictique/src/routes/(protected)/profile/[id]/+page.svelte @@ -15,6 +15,7 @@ let error = $state(null); let loading = $state(true); let ownerId: string | null = $derived(getAuthId()); + let isFollowing = $state(false); let ownerProfile = $derived.by(async () => { if (ownerId) { const response = await apiClient.get(`/api/users/${ownerId}`); @@ -39,10 +40,13 @@ async function handleFollow() { try { + isFollowing = true; await apiClient.post(`/api/users/${profileId}/follow`); - await fetchProfile(); // Refresh profile to update follower count + // await fetchProfile(); // Refresh profile to update follower count } catch (err) { error = err instanceof Error ? err.message : 'Failed to follow user'; + } finally { + isFollowing = false; } } @@ -79,6 +83,7 @@ {:else if profile} handlePostClick(post)}