Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 21 09:44:08 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Do not crash at the end of the installation when using a legacy
AutoYaST mode (gh#agama-project/agama#1927).

-------------------------------------------------------------------
Mon Jan 20 16:45:18 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

Expand Down
4 changes: 2 additions & 2 deletions web/src/api/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import { config } from "~/api/storage/types";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const probe = (): Promise<any> => post("/api/storage/probe");

const fetchConfig = (): Promise<config.Config | undefined> =>
get("/api/storage/config").then((config) => config.storage);
const fetchConfig = (): Promise<config.Config | null> =>
get("/api/storage/config").then((config) => config.storage ?? null);

/**
* Returns the list of jobs
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/core/InstallationFinished.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ const SuccessIcon = () => <Icon name="check_circle" className="icon-xxxl color-s
// TODO: define some utility method to get the device used as root (drive, partition, logical volume).
// TODO: use type checking for config.
function usingTpm(config): boolean {
if (!config) {
return null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note.

Would be nice to be consistent in the way we return early from a component to tell React renders nothing.

I for sure know that no matters if you return undefined or null, React will understand both of them as nothing. But we used to go for

if (something) return;

Which returns undefined, the default return value for a JavaScript function.

Now we've a small dilemma with it comes to consistence because, as stated in the PR, react-query requires the query returns always something (null meaning nothing).

We can, of course, choose a default return value for everything or one for components and another for queries, but betting for consistency in each case for easing code maintenance.

}

const { guided, drives = [], volumeGroups = [] } = config;

if (guided !== undefined) {
Expand Down