Skip to content

Commit

Permalink
fix(pref-v4/list): fix hosted pref page flash on load. (prevent compo…
Browse files Browse the repository at this point in the history
…nent from un-mounting)
  • Loading branch information
misabel committed Jul 13, 2023
1 parent c7112c8 commit cf61c67
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const PreferenceList: React.FunctionComponent<{
}, []);

const renderPreferences = () => {
if (preferences?.isLoading) {
if (!preferences.preferencePage?.sections?.nodes.length) {
return <></>;
}

Expand Down
4 changes: 0 additions & 4 deletions packages/react-preferences/src/components/PreferencesV4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,6 @@ export const PreferencesV4: React.FC<{ accountId?: string; draft?: boolean }> =
pullPreferences();
}, []);

if (preferences.isLoading || typeof preferences.isLoading === "undefined") {
return null;
}

if (!preferences.preferencePage && !preferences.isLoading) {
return (
<div>
Expand Down

0 comments on commit cf61c67

Please sign in to comment.