Skip to content

Commit

Permalink
fix(web): wrap the application in a <Suspense/> component (#1654)
Browse files Browse the repository at this point in the history
* Wrap the application on a `<Suspense />` to handle a problem that was
most probably introduced in #1639.
* Add a missing entry to the changes file.
  • Loading branch information
imobachgs authored Oct 3, 2024
2 parents 6a7eddc + d00b304 commit d57f8e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Oct 3 10:20:34 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Drop the old HTTPClient (gh#agama-project/agama#1639).

-------------------------------------------------------------------
Mon Sep 30 08:52:36 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand All @@ -14,7 +19,7 @@ Fri Sep 27 13:00:05 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Properly translate the storage interface when switching
the language of the UI (gh#agama-project/agama#1629).

-------------------------------------------------------------------
Mon Sep 23 09:04:56 UTC 2024 - Knut Anderssen <kanderssen@suse.com>

Expand Down
9 changes: 7 additions & 2 deletions web/src/context/root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

// @ts-check

import React from "react";
import React, { Suspense } from "react";
import { AuthProvider } from "./auth";
import { Loading } from "~/components/layout";

/**
* Combines all application providers.
Expand All @@ -32,7 +33,11 @@ import { AuthProvider } from "./auth";
* @param {React.ReactNode} [props.children] - content to display within the provider.
*/
function RootProviders({ children }) {
return <AuthProvider>{children}</AuthProvider>;
return (
<Suspense fallback={<Loading />}>
<AuthProvider>{children}</AuthProvider>
</Suspense>
);
}

export { RootProviders };

0 comments on commit d57f8e6

Please sign in to comment.