Merge pull request #256 from appwrite/fix/flutter-wizard-step-persistence

Fix: Flutter platform wizard persistence
This commit is contained in:
Torsten Dittmann
2023-02-14 16:57:16 +01:00
committed by GitHub
2 changed files with 11 additions and 21 deletions
@@ -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(
@@ -52,6 +43,7 @@
});
$createPlatform.$id = response.$id;
$createPlatform.type = platform;
}
</script>
@@ -22,7 +22,13 @@
Web = 'flutter-web'
}
let platform: Platform = Platform.Android;
function isPlatform(value: string): value is Platform {
return Object.values(Platform).includes(value as Platform);
}
let platform: Platform = isPlatform($createPlatform.type)
? $createPlatform.type
: Platform.Android;
const projectId = $page.params.project;
const suggestions = ['*.vercel.app', '*.netlify.app', '*.gitpod.io'];
@@ -81,16 +87,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(
@@ -107,6 +104,7 @@
});
$createPlatform.$id = response.$id;
$createPlatform.type = platform;
}
</script>