From 1e66f2302c9530869ab1f3a049f048ba2f774af9 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 13 Feb 2021 23:07:02 +0100 Subject: [PATCH] Fixed the about modal for the native client --- shared/js/ui/modal/ModalAbout.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/shared/js/ui/modal/ModalAbout.ts b/shared/js/ui/modal/ModalAbout.ts index 38b63ab0..4514cfd0 100644 --- a/shared/js/ui/modal/ModalAbout.ts +++ b/shared/js/ui/modal/ModalAbout.ts @@ -1,5 +1,5 @@ import {createModal} from "../../ui/elements/Modal"; -import {LogCategory, logError} from "../../log"; +import {getBackend} from "tc-shared/backend"; import {tr} from "tc-shared/i18n/localize"; function format_date(date: number) { @@ -30,11 +30,7 @@ export function spawnAbout() { connectModal.open(); if (__build.target !== "web") { - (window as any).native.client_version().then(version => { - connectModal.htmlTag.find(".version-client").text(version); - }).catch(error => { - logError(LogCategory.GENERAL, tr("Failed to load client version: %o"), error); - connectModal.htmlTag.find(".version-client").text("unknown"); - }); + const version = getBackend("native").getVersionInfo(); + connectModal.htmlTag.find(".version-client").text(version.version); } } \ No newline at end of file