Skip to content

Commit

Permalink
fix(web): App uses the Suspense API while loading the selected product (
Browse files Browse the repository at this point in the history
#1877)

## Problem

The <App/> component does not wait for the information about the
selected product to be loaded.
In some corner cases, it may redirect to the software selection page
even if it is not needed.

## Solution

Use the Suspense API to be sure that the product is not selected before
redirecting to the product
selection page automatically.

## Testing

- *Tested manually*
  • Loading branch information
imobachgs authored Jan 9, 2025
2 parents ba3f8dd + a0dc904 commit 2eb9ad2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function App() {
const location = useLocation();
const { isBusy, phase } = useInstallerStatus({ suspense: true });
const { connected, error } = useInstallerClientStatus();
const { selectedProduct, products } = useProduct();
const { selectedProduct, products } = useProduct({ suspense: true });
const { language } = useInstallerL10n();
const { password: isRootPasswordDefined, sshkey: rootSSHKey } = useRootUser();
useL10nConfigChanges();
Expand Down

0 comments on commit 2eb9ad2

Please sign in to comment.