Skip to content

Commit

Permalink
feat: display onboarding wizard if no cloud account was connected
Browse files Browse the repository at this point in the history
  • Loading branch information
greghub committed Sep 21, 2023
1 parent e1353a2 commit 8686e0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ function useCloudAccount() {
const [error, setError] = useState(false);

useEffect(() => {
settingsService.getOnboardingStatus().then(res => {
if (res === Error || res.onboarded === false) {
router.push('/onboarding/choose-cloud');
}
});

settingsService.getCloudAccounts().then(res => {
if (!loading) {
setLoading(true);
Expand Down
10 changes: 10 additions & 0 deletions dashboard/services/settingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,16 @@ const settingsService = {
} catch (error) {
return Error;
}
},

async getOnboardingStatus() {
try {
const res = await fetch(`${BASE_URL}/is_onboarded`, settings('GET'));
const data = await res.json();
return data;
} catch (error) {
return Error;
}
}
};

Expand Down

0 comments on commit 8686e0d

Please sign in to comment.