Skip to content

Commit edc4a0d

Browse files
committed
Add new variable for version up to date message
Fixes error TS2740 reported by TypeScript. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 03b8efd commit edc4a0d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

js/src/modules/git-info.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ const GitInfo = {
8888
$('#maincontainer').append($(mainContainerDiv));
8989
}
9090

91+
let upToDateMessage: Text | null = null;
9192
if (latest === current) {
92-
versionInformationMessage = document.createTextNode(' (' + window.Messages.strUpToDate + ')');
93+
upToDateMessage = document.createTextNode(' (' + window.Messages.strUpToDate + ')');
9394
}
9495

9596
/* Remove extra whitespace */
@@ -100,7 +101,11 @@ const GitInfo = {
100101

101102
const $liPmaVersion = $('#li_pma_version');
102103
$liPmaVersion.find('span.latest').remove();
103-
$liPmaVersion.append($(versionInformationMessage));
104+
if (upToDateMessage !== null) {
105+
$liPmaVersion.append($(upToDateMessage));
106+
} else {
107+
$liPmaVersion.append($(versionInformationMessage));
108+
}
104109
}
105110
},
106111

webpack.config.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const typeScriptErrorsToIgnore = [
2121
2469, // TS2469: The '+' operator cannot be applied to type 'symbol'.
2222
2538, // TS2538: Type '%s' cannot be used as an index type.
2323
2551, // TS2551: Property '%s' does not exist on type '%s'. Did you mean '%s'?
24-
2740, // TS2740: Type 'Text' is missing the following properties from type 'HTMLSpanElement': accessKey, accessKeyLabel, autocapitalize, dir, and 226 more.
2524
2769, // TS2769: No overload matches this call.
2625
5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
2726
];

0 commit comments

Comments
 (0)