From 2ee38f43d2e4ebc590f8076833a9a3b20c49e7f0 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Sun, 7 May 2023 19:17:16 +0800
Subject: [PATCH] Fix reload issues in Notifications

---
 src/components/notification.jsx | 4 ++--
 src/pages/notifications.jsx     | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/components/notification.jsx b/src/components/notification.jsx
index d3714119..64bb1060 100644
--- a/src/components/notification.jsx
+++ b/src/components/notification.jsx
@@ -49,7 +49,7 @@ const contentText = {
   'favourite+reblog': 'boosted & favourited your post.',
 };
 
-function Notification({ notification, instance }) {
+function Notification({ notification, instance, reload }) {
   const { id, status, account, _accounts } = notification;
   let { type } = notification;
 
@@ -137,7 +137,7 @@ function Notification({ notification, instance }) {
               <FollowRequestButtons
                 accountID={account.id}
                 onChange={() => {
-                  loadNotifications(true);
+                  reload();
                 }}
               />
             )}
diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx
index 1ecbe8c6..b3779f2c 100644
--- a/src/pages/notifications.jsx
+++ b/src/pages/notifications.jsx
@@ -285,6 +285,7 @@ function Notifications() {
                     accountID={account.id}
                     onChange={() => {
                       loadFollowRequests();
+                      loadNotifications(true);
                     }}
                   />
                 </li>
@@ -337,6 +338,10 @@ function Notifications() {
                     instance={instance}
                     notification={notification}
                     key={notification.id}
+                    reload={() => {
+                      loadNotifications(true);
+                      loadFollowRequests();
+                    }}
                   />
                 </>
               );