Skip to content

Commit

Permalink
SLVUU-69: Display toast on failed layout load
Browse files Browse the repository at this point in the history
  • Loading branch information
pling-scottlogic committed Nov 23, 2023
1 parent 4b3eeff commit 129f86b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const LayoutManagementProvider = (
notify({
type: NotificationLevel.Error,
header: "Failed to Save Layout",
body: `Failed to save layout ${metadata.name} to server`,
body: `Failed to save layout ${metadata.name}`,
});
console.error("Error occurred while saving layout", error);
});
Expand All @@ -173,9 +173,17 @@ export const LayoutManagementProvider = (
active: prev.children?.length ?? 0,
children: [...(prev.children || []), layoutJson],
});
})
.catch((error: Error) => {
notify({
type: NotificationLevel.Error,
header: "Failed to Load Layout",
body: "Failed to load the requested layout",
});
console.error("Error occurred while loading layout", error);
});
},
[setApplicationLayout]
[notify, setApplicationLayout]
);

return (
Expand Down

0 comments on commit 129f86b

Please sign in to comment.