From cdcbda5e65f86cb27743c7618ed438bdb60a688c Mon Sep 17 00:00:00 2001
From: Saurabh Kumar <theskumar@users.noreply.github.com>
Date: Mon, 2 Oct 2023 21:26:32 +0530
Subject: [PATCH] Show activity feed after the page load (#3571)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

HTMX shows "Loading…" when reloading the "#activity-feed" tabs on
submissions and projects

https://alpinejs.dev/directives/init#next-tick

Fixes #3568
---
 .../funds/templates/funds/applicationsubmission_detail.html    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html
index 1dfba9b0a..66b72c2ee 100644
--- a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html
+++ b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html
@@ -55,9 +55,8 @@
                        hx-target="#tab-3 .feed"
                        hx-trigger="open-tab-3 once"
                        data-tab="tab-3"
-                       x-data
+                       x-init="$nextTick(() => { location.hash === '#activity-feed' ? $dispatch('open-tab-3') : '' })"
                        @hashchange.window="location.hash === '#activity-feed' ? $dispatch('open-tab-3') : ''"
-                       x-init="location.hash === '#activity-feed' ? $dispatch('open-tab-3') : ''"
                     >
                         {% trans "Activity feed" %}
                     </a>
-- 
GitLab