From 172fa4ad1483eebe598282d80d41fad8c86823ba Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:29:30 +0200 Subject: [PATCH] Fix last sync date --- src/features/settings/screens/ServerSettings.tsx | 7 ++++--- src/i18n/locales/en.po | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/features/settings/screens/ServerSettings.tsx b/src/features/settings/screens/ServerSettings.tsx index 75f7cc12..5b416020 100644 --- a/src/features/settings/screens/ServerSettings.tsx +++ b/src/features/settings/screens/ServerSettings.tsx @@ -62,7 +62,7 @@ import ListItemButton from '@mui/material/ListItemButton'; import { AwaitableComponent } from 'awaitable-component'; import { convertToAutoBackupFlags, getAutoBackupFlagsInfo } from '@/features/backup/Backup.utils.ts'; import type { BackupFlagInclusionState } from '@/features/backup/Backup.types.ts'; -import { epochToDate, getDateString } from '@/base/utils/DateHelper.ts'; +import { getDateString } from '@/base/utils/DateHelper.ts'; const convertSyncDataToBackupFlags = (settings: ServerSettingsType): BackupFlagInclusionState => ({ includeManga: settings.syncDataManga, @@ -236,7 +236,8 @@ export const ServerSettings = () => { const excludedSyncDataText = syncDataFlagsInfo.false; const syncStatus = syncStatusRequest.data?.lastSyncStatus; - const syncDate = syncStatus?.endDate ?? syncStatus?.startDate; + const tmpSyncDate = syncStatus?.endDate ?? syncStatus?.startDate; + const syncDate = tmpSyncDate ? getDateString(Number(tmpSyncDate), true, true) : undefined; const syncState = syncStatus?.state; const isSyncing = !!syncState && ![SyncState.Success, SyncState.Error].includes(syncState); @@ -771,7 +772,7 @@ export const ServerSettings = () => { primary={isSyncing ? t`Sync status` : t`Start sync`} secondary={ <> - {syncDate && t`Last sync: ${getDateString(epochToDate(Number(syncDate)), true, true)}`}{' '} + {syncDate && t`Last sync: ${syncDate}`}{' '} {syncState && t`- State: ${t(SYNC_STATE_TRANSLATION[syncState])}`} {!!syncStatus?.errorMessage && `\nError: ${syncStatus.errorMessage}`} diff --git a/src/i18n/locales/en.po b/src/i18n/locales/en.po index bcb3e82c..d92fd781 100644 --- a/src/i18n/locales/en.po +++ b/src/i18n/locales/en.po @@ -2194,10 +2194,9 @@ msgstr "Large" msgid "Last read chapter" msgstr "Last read chapter" -#. placeholder {0}: getDateString(epochToDate(Number(syncDate)), true, true) #: src/features/settings/screens/ServerSettings.tsx -msgid "Last sync: {0}" -msgstr "Last sync: {0}" +msgid "Last sync: {syncDate}" +msgstr "Last sync: {syncDate}" #: src/features/updates/screens/Updates.tsx msgid "Last update: {date}"