fix(migration): show correct help message when a migration was started
This commit is contained in:
parent
b2e5de88ff
commit
997fb6bc54
@ -53,7 +53,7 @@
|
|||||||
<p>{{ $t('migrate.inProgress') }}</p>
|
<p>{{ $t('migrate.inProgress') }}</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-else-if="lastMigrationStartedAt && lastMigrationFinishedAt === null">
|
<div v-else-if="!migrationJustStarted && lastMigrationStartedAt && lastMigrationFinishedAt === null">
|
||||||
<Message class="mb-4">
|
<Message class="mb-4">
|
||||||
{{ $t('migrate.migrationInProgress') }}
|
{{ $t('migrate.migrationInProgress') }}
|
||||||
</Message>
|
</Message>
|
||||||
@ -145,6 +145,7 @@ const lastMigrationFinishedAt = ref<Date | null>(null)
|
|||||||
const lastMigrationStartedAt = ref<Date | null>(null)
|
const lastMigrationStartedAt = ref<Date | null>(null)
|
||||||
const message = ref('')
|
const message = ref('')
|
||||||
const migratorAuthCode = ref('')
|
const migratorAuthCode = ref('')
|
||||||
|
const migrationJustStarted = ref(false)
|
||||||
|
|
||||||
const migrator = computed<Migrator>(() => MIGRATORS[props.service])
|
const migrator = computed<Migrator>(() => MIGRATORS[props.service])
|
||||||
|
|
||||||
@ -207,12 +208,15 @@ async function migrate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = migrator.value.isFileMigrator
|
if (migrator.value.isFileMigrator) {
|
||||||
? await migrationFileService.migrate(migrationConfig as File)
|
const result = await migrationFileService.migrate(migrationConfig as File)
|
||||||
: await migrationService.migrate(migrationConfig as MigrationConfig)
|
message.value = result.message
|
||||||
message.value = result.message
|
const projectStore = useProjectStore()
|
||||||
const projectStore = useProjectStore()
|
return projectStore.loadProjects()
|
||||||
return projectStore.loadProjects()
|
}
|
||||||
|
|
||||||
|
await migrationService.migrate(migrationConfig as MigrationConfig)
|
||||||
|
migrationJustStarted.value = true
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user