From 4c343aee3eab4a7dd370d307f1adb9101355fe1c Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 15 Sep 2022 04:59:32 -0700 Subject: [PATCH] Stop doing the weird login bouncy bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The item page got in a weird situation where this setting seemed to cause loading things _about_ `currentUser` to make the `useCurrentUser` GQL query flake out and say it's loading. This would make the layout bounce around a bunch while it tries to decide whether to show you the buttons or not. I still don't love the UX of not having any loading state after login, but likeā€¦ eh it's certainly better lmao --- src/app/components/useCurrentUser.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/app/components/useCurrentUser.js b/src/app/components/useCurrentUser.js index 69e5ff3..359eae9 100644 --- a/src/app/components/useCurrentUser.js +++ b/src/app/components/useCurrentUser.js @@ -96,12 +96,6 @@ function useCurrentUserViaDb({ isEnabled }) { // something is wrong and they need to reach out. console.error("[useCurrentUser] Couldn't get current user:", error); }, - // We set this option so that, when we enter the loading state after - // logging in and evicting `currentUser` from the cache, we'll see the - // `loading: true` state. Otherwise, Apollo just leaves the return value - // as-is until the new data comes in, so the user sees the logged-out - // state until the behind-the-scenes update to this query finishes. - notifyOnNetworkStatusChange: true, } );