mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1043 from appwrite/fix-project-creation
fix: add option to pass final action directly to the wizard so it can be awaited
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
export let steps: WizardStepsType;
|
||||
export let confirmExit = false;
|
||||
export let finalAction = 'Create';
|
||||
export let finalMethod: () => Promise<void> = null;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
@@ -94,11 +95,18 @@
|
||||
}
|
||||
} else {
|
||||
$wizard.nextDisabled = true;
|
||||
trackEvent('wizard_finish');
|
||||
dispatch('finish');
|
||||
setTimeout(() => {
|
||||
if (finalMethod) {
|
||||
await finalMethod();
|
||||
trackEvent('wizard_finish');
|
||||
$wizard.nextDisabled = false;
|
||||
}, 2000);
|
||||
} else {
|
||||
trackEvent('wizard_finish');
|
||||
dispatch('finish');
|
||||
|
||||
setTimeout(() => {
|
||||
$wizard.nextDisabled = false;
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (steps.get($wizard.step + 1)?.disabled) {
|
||||
|
||||
@@ -67,4 +67,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<Wizard title="Create project" steps={stepsComponents} on:finish={create} on:exit={onFinish} />
|
||||
<Wizard title="Create project" steps={stepsComponents} finalMethod={create} on:exit={onFinish} />
|
||||
|
||||
Reference in New Issue
Block a user