fix(ui): cancel loading state properly for select folder button in onboarding

This commit is contained in:
Brian McGee
2025-08-20 16:16:01 +01:00
parent 349da24b29
commit 1a1addb19d

View File

@@ -99,9 +99,17 @@ const welcome = (props: {
const selectFolder = async () => {
setLoading(true);
const uri = await selectClanFolder();
setLoading(false);
navigateToClan(navigate, uri);
try {
const uri = await selectClanFolder();
setLoading(false);
navigateToClan(navigate, uri);
} catch (e) {
// todo display error, currently we don't get anything to distinguish between cancel or an actual error
} finally {
// stop the loading state of the button
setLoading(false);
}
};
return (
@@ -151,7 +159,7 @@ const welcome = (props: {
</div>
<Button
hierarchy="primary"
ghost={true}
ghost
loading={loading()}
onClick={selectFolder}
>