fix(migration): show correct help message when a migration was started

This commit is contained in:
kolaente 2024-02-27 16:36:18 +01:00
parent b2e5de88ff
commit 997fb6bc54
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 7 deletions

View File

@ -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 {