diff --git a/.gitignore b/.gitignore index 551917e..f00b20f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ tests/e2e/reports/ .env.* !.env.example !tests/e2e/.env.e2e.example +AGENTS.md diff --git a/app/app.vue b/app/app.vue index 82abbc4..696a29e 100644 --- a/app/app.vue +++ b/app/app.vue @@ -2,12 +2,38 @@ import { useAppI18n } from '~/composables/useAppI18n' import { useThemePreference } from '~/composables/useThemePreference' +const MIN_STARTUP_OVERLAY_MS = 700 + const { initializeThemePreference } = useThemePreference() -const { isSessionRestoreInProgress } = useMatrixClient() +const { + isSessionRestoreInProgress, + ensureSessionRestoreCompleted +} = useMatrixClient() const { translateText } = useAppI18n() +const isBootingApp = ref(true) + +const showStartupOverlay = computed(() => { + return isBootingApp.value || isSessionRestoreInProgress.value +}) + +function waitMilliseconds(durationMs: number): Promise { + if (durationMs <= 0) { + return Promise.resolve() + } + return new Promise((resolve) => { + window.setTimeout(() => resolve(), durationMs) + }) +} -onMounted(() => { +onMounted(async () => { + const bootStartTimestamp = Date.now() initializeThemePreference() + if (typeof ensureSessionRestoreCompleted === 'function') { + await ensureSessionRestoreCompleted() + } + const bootElapsedMs = Date.now() - bootStartTimestamp + await waitMilliseconds(MIN_STARTUP_OVERLAY_MS - bootElapsedMs) + isBootingApp.value = false }) @@ -16,7 +42,7 @@ onMounted(() => {
{ class="h-6 w-6 animate-spin text-primary" />

- {{ translateText('auth.restoringSession') }} + {{ translateText('common.loading') }}

diff --git a/app/components/Chat/MessageList.vue b/app/components/Chat/MessageList.vue index 5cc4d31..4ae160c 100644 --- a/app/components/Chat/MessageList.vue +++ b/app/components/Chat/MessageList.vue @@ -1,7 +1,9 @@