mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: add option to pass final action directly to the wizard so it can be awaited
This commit is contained in:
1 parent
d9294ac6aa
commit
4c5748903c
2 files changed
+12
-5
No files matched your search
@@ -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,17 @@
|
||||
}
|
||||
} else {
|
||||
$wizard.nextDisabled = true;
|
||||
trackEvent('wizard_finish');
|
||||
dispatch('finish');
|
||||
setTimeout(() => {
|
||||
if (finalMethod) {
|
||||
await finalMethod();
|
||||
$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