From edc4a0d41f34053244ea1cd8c67774b6b653c3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 5 Apr 2023 15:45:47 -0300 Subject: [PATCH] Add new variable for version up to date message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes error TS2740 reported by TypeScript. Signed-off-by: MaurĂ­cio Meneghini Fauth --- js/src/modules/git-info.ts | 9 +++++++-- webpack.config.cjs | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/src/modules/git-info.ts b/js/src/modules/git-info.ts index 8afbb00fa0..9c4f502efb 100644 --- a/js/src/modules/git-info.ts +++ b/js/src/modules/git-info.ts @@ -88,8 +88,9 @@ const GitInfo = { $('#maincontainer').append($(mainContainerDiv)); } + let upToDateMessage: Text | null = null; if (latest === current) { - versionInformationMessage = document.createTextNode(' (' + window.Messages.strUpToDate + ')'); + upToDateMessage = document.createTextNode(' (' + window.Messages.strUpToDate + ')'); } /* Remove extra whitespace */ @@ -100,7 +101,11 @@ const GitInfo = { const $liPmaVersion = $('#li_pma_version'); $liPmaVersion.find('span.latest').remove(); - $liPmaVersion.append($(versionInformationMessage)); + if (upToDateMessage !== null) { + $liPmaVersion.append($(upToDateMessage)); + } else { + $liPmaVersion.append($(versionInformationMessage)); + } } }, diff --git a/webpack.config.cjs b/webpack.config.cjs index 303146ebb9..8da0c323ff 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -21,7 +21,6 @@ const typeScriptErrorsToIgnore = [ 2469, // TS2469: The '+' operator cannot be applied to type 'symbol'. 2538, // TS2538: Type '%s' cannot be used as an index type. 2551, // TS2551: Property '%s' does not exist on type '%s'. Did you mean '%s'? - 2740, // TS2740: Type 'Text' is missing the following properties from type 'HTMLSpanElement': accessKey, accessKeyLabel, autocapitalize, dir, and 226 more. 2769, // TS2769: No overload matches this call. 5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set. ];