Skip to content

Commit

Permalink
fix: persistence across flutter and apple platform creation
Browse files Browse the repository at this point in the history
  • Loading branch information
TGlide committed Feb 14, 2023
1 parent 6b1c63a commit 30a5bab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@
async function beforeSubmit() {
if ($createPlatform.$id) {
await sdkForConsole.projects.updatePlatform(
projectId,
$createPlatform.$id,
$createPlatform.name,
$createPlatform.key,
$createPlatform.store,
$createPlatform.hostname
);
return;
await sdkForConsole.projects.deletePlatform(projectId, $createPlatform.$id);
}
const response = await sdkForConsole.projects.createPlatform(
Expand All @@ -52,6 +43,7 @@
});
$createPlatform.$id = response.$id;
$createPlatform.type = platform;
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,23 @@
async function beforeSubmit() {
if ($createPlatform.$id) {
await sdkForConsole.projects.updatePlatform(
projectId,
$createPlatform.$id,
$createPlatform.name,
$createPlatform.key,
$createPlatform.store,
$createPlatform.hostname
);
} else {
const response = await sdkForConsole.projects.createPlatform(
projectId,
platform,
$createPlatform.name,
platform !== Platform.Web ? $createPlatform.key : undefined,
undefined,
platform === Platform.Web ? $createPlatform.hostname : undefined
);
await sdkForConsole.projects.deletePlatform(projectId, $createPlatform.$id);
}
trackEvent('submit_platform_create', {
type: platform
});
const response = await sdkForConsole.projects.createPlatform(
projectId,
platform,
$createPlatform.name,
platform !== Platform.Web ? $createPlatform.key : undefined,
undefined,
platform === Platform.Web ? $createPlatform.hostname : undefined
);
$createPlatform.$id = response.$id;
}
trackEvent('submit_platform_create', {
type: platform
});
$createPlatform.$id = response.$id;
$createPlatform.type = platform;
}
</script>
Expand Down

0 comments on commit 30a5bab

Please sign in to comment.