From d1f527d573a6d2c993e2eadd285096f033bb922d Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 12 Sep 2024 12:04:52 +1000 Subject: [PATCH] fix: fix download session modal duplicate string displayed --- ts/mains/main_node.ts | 4 ++-- ts/node/latest_desktop_release.ts | 4 ++-- ts/updater/common.ts | 1 - ts/updater/updater.ts | 8 ++++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ts/mains/main_node.ts b/ts/mains/main_node.ts index 3ba90914b..ecc87816a 100644 --- a/ts/mains/main_node.ts +++ b/ts/mains/main_node.ts @@ -158,7 +158,7 @@ if (windowFromUserConfig) { import { readFile } from 'fs-extra'; import { getAppRootPath } from '../node/getRootPath'; -import { setLastestRelease } from '../node/latest_desktop_release'; +import { setLatestRelease } from '../node/latest_desktop_release'; import { isDevProd, isTestIntegration } from '../shared/env_vars'; import { classicDark } from '../themes'; import type { SetupI18nReturnType } from '../types/localizer'; @@ -492,7 +492,7 @@ ipc.on('show-window', () => { }); ipc.on('set-release-from-file-server', (_event, releaseGotFromFileServer) => { - setLastestRelease(releaseGotFromFileServer); + setLatestRelease(releaseGotFromFileServer); }); let isReadyForUpdates = false; diff --git a/ts/node/latest_desktop_release.ts b/ts/node/latest_desktop_release.ts index a27db8016..0dae4434b 100644 --- a/ts/node/latest_desktop_release.ts +++ b/ts/node/latest_desktop_release.ts @@ -1,9 +1,9 @@ let latestRelease: string | undefined; -export function setLastestRelease(release: string) { +export function setLatestRelease(release: string) { latestRelease = release; } -export function getLastestRelease() { +export function getLatestRelease() { return latestRelease; } diff --git a/ts/updater/common.ts b/ts/updater/common.ts index c2dff1a5b..1cd9a28f7 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -27,7 +27,6 @@ export async function showDownloadUpdateDialog( buttons: [i18n('download'), i18n('later')], title: i18n('updateSession'), message: i18n('updateNewVersionDescription'), - detail: i18n('updateNewVersionDescription'), defaultId: LATER_BUTTON, cancelId: DOWNLOAD_BUTTON, }; diff --git a/ts/updater/updater.ts b/ts/updater/updater.ts index d2bf2bc81..d4941f826 100644 --- a/ts/updater/updater.ts +++ b/ts/updater/updater.ts @@ -1,14 +1,15 @@ /* eslint-disable @typescript-eslint/no-misused-promises */ /* eslint-disable no-console */ -import * as path from 'path'; import { app, type BrowserWindow } from 'electron'; import { autoUpdater, type UpdateInfo } from 'electron-updater'; import * as fs from 'fs-extra'; +import * as path from 'path'; import { gt as isVersionGreaterThan, parse as parseVersion } from 'semver'; import { windowMarkShouldQuit } from '../node/window_state'; -import { getLastestRelease } from '../node/latest_desktop_release'; +import { getLatestRelease } from '../node/latest_desktop_release'; +import type { SetupI18nReturnType } from '../types/localizer'; import { getPrintableError, type LoggerType, @@ -16,7 +17,6 @@ import { showDownloadUpdateDialog, showUpdateDialog, } from './common'; -import type { SetupI18nReturnType } from '../types/localizer'; let isUpdating = false; let downloadIgnored = false; @@ -95,7 +95,7 @@ async function checkForUpdates( isUpdating = true; try { - const latestVersionFromFsFromRenderer = getLastestRelease(); + const latestVersionFromFsFromRenderer = getLatestRelease(); logger.info('[updater] latestVersionFromFsFromRenderer', latestVersionFromFsFromRenderer); if (!latestVersionFromFsFromRenderer || !latestVersionFromFsFromRenderer?.length) {