fix: onboarding?

This commit is contained in:
Arman committed 2025-05-16 09:53:20 +02:00
1 parent 1dc5c71c65
commit a74c0a143d
2 files changed
+24 -30

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ import { page } from '$app/state';
export function getFlagUrl(countryCode: string) {
if (!isValueOfStringEnum(Flag, countryCode)) return '';
return sdk
.forProject(page.params.region, page.params.project)
.forProject(page.params.region, 'console')
.avatars.getFlag(countryCode, 22, 15, 100)
?.toString();
}
@@ -21,38 +21,32 @@
async function createProject() {
isLoading = true;
if (data.organization) {
try {
const teamId = data.organization.$id;
try {
const project = await sdk.forConsole.projects.create(
id ?? ID.unique(),
projectName,
teamId,
region
);
trackEvent(Submit.ProjectCreate, {
customId: !!id,
teamId
});
const project = await sdk.forConsole.projects.create(
id ?? ID.unique(),
projectName,
teamId,
region
);
trackEvent(Submit.ProjectCreate, {
customId: !!id,
teamId
});
startAnimation = true;
startAnimation = true;
trackEvent(Submit.ProjectCreate, {
teamId: teamId
});
setTimeout(async () => {
await invalidate(Dependencies.ACCOUNT);
goto(`${base}/project-${project.region}-${project.$id}`);
}, 3000);
} catch (e) {
trackError(e, Submit.ProjectCreate);
isLoading = false;
addNotification({
type: 'error',
message: e.message
});
}
setTimeout(async () => {
await invalidate(Dependencies.ACCOUNT);
goto(`${base}/project-${project.region}-${project.$id}`);
}, 3000);
} catch (e) {
trackError(e, Submit.ProjectCreate);
isLoading = false;
addNotification({
type: 'error',
message: e.message
});
}
}
</script>