mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #256 from appwrite/fix/flutter-wizard-step-persistence
Fix: Flutter platform wizard persistence
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
+9
-11
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user