From 9e13f1bee2e8fbe0b3838cdc0dd8ef85e3d3594b Mon Sep 17 00:00:00 2001 From: Appbird Date: Thu, 2 Sep 2021 15:06:12 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[modify]=20#2=20version=E3=81=AE=E3=83=97?= =?UTF-8?q?=E3=83=AD=E3=83=91=E3=83=86=E3=82=A3=E3=81=AE=E5=9E=8B=E3=82=92?= =?UTF-8?q?string=E3=81=8B=E3=82=89Promise=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit versionのデータを外部からのデータを取得するため。 --- src/ts/client/interface/AppInterfaces.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/client/interface/AppInterfaces.ts b/src/ts/client/interface/AppInterfaces.ts index 60d3c4b..ee48060 100644 --- a/src/ts/client/interface/AppInterfaces.ts +++ b/src/ts/client/interface/AppInterfaces.ts @@ -9,7 +9,7 @@ import { PageStates, RequiredObjectType } from "../view/state/Base/PageStates"; export interface IAppUsedToRead{ - readonly version:string; + readonly version:Promise; state:StateAdministerReadOnly; loginAdministratorReadOnly:LoginAdministratorReadOnly; checkIfIntroductionIsOver:()=>boolean; From e65d59055e872d3bbeaeb6031ccd22509220e5b1 Mon Sep 17 00:00:00 2001 From: Appbird Date: Thu, 2 Sep 2021 15:08:06 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[modify]=20App#version=E3=82=92getter?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97=E3=80=81github=E3=81=AE?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E3=81=AE=E3=82=BF=E3=82=B0=E3=81=8B=E3=82=89?= =?UTF-8?q?version=E3=81=8C=E5=8F=96=E5=BE=97=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ts/client/App.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ts/client/App.ts b/src/ts/client/App.ts index 94b618b..d05d336 100644 --- a/src/ts/client/App.ts +++ b/src/ts/client/App.ts @@ -12,7 +12,6 @@ import { LoginAdministrator, LoginAdministratorReadOnly } from "./Administrator/ import { IAppUsedToChangeState } from "./interface/AppInterfaces"; import firebase from "firebase/app"; import {PageNotificationAdministrator} from "./Administrator/PageNotificationAdministrator" -import {version} from "../AppInfo.json" export default class App implements IAppUsedToChangeState{ private _state:StateAdministrator; private loginAd:LoginAdministrator | null = null; @@ -21,8 +20,6 @@ export default class App implements IAppUsedToChangeState{ private header:HeaderController = new HeaderController(); private apiCaller:APIAdministrator = new APIAdministrator(); private _notie:PageNotificationAdministrator; - - public readonly version:string = version constructor(articleDOM:HTMLElement,language:LanguageInApplication){ this._state = new StateAdministrator(language); this._notie = new PageNotificationAdministrator(this); @@ -33,6 +30,12 @@ export default class App implements IAppUsedToChangeState{ this.transition("mainMenu",null) }) } + get version():Promise{ + return fetch("https://api.github.com/repos/appbird/kss-recorders/releases/latest") + .then(result => result.json()) + .then(result => result.tag_name) + .catch((err) => this.errorCatcher(err)); + } async init(){ try{ const response = await fetch('/__/firebase/init.json'); From eb3aaaeed204a1e88f3a3b50ea6d93239e5ef2d0 Mon Sep 17 00:00:00 2001 From: Appbird Date: Thu, 2 Sep 2021 15:09:08 +0900 Subject: [PATCH 3/4] =?UTF-8?q?App=E3=81=AE=E4=BB=95=E6=A7=98=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=80=81version?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=82=92=E5=88=A9=E7=94=A8=E3=81=99=E3=82=8B?= =?UTF-8?q?=E9=83=A8=E3=81=ABasync=E3=81=A8await=E3=82=92=E4=BB=98?= =?UTF-8?q?=E8=A8=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ts/client/view/state/mainMenu.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ts/client/view/state/mainMenu.ts b/src/ts/client/view/state/mainMenu.ts index 2ee9364..9a85949 100644 --- a/src/ts/client/view/state/mainMenu.ts +++ b/src/ts/client/view/state/mainMenu.ts @@ -47,7 +47,7 @@ export class S_MainMenu },this.generateDetailMenuInfo()] ] const notice = new NoticeView(appendElement(this.articleDOM,"div"),"mainMenu","headerDescription",context.mainManu,this.app.state.language) - const main = (gsed.gameSystem !== null && gsed.gameMode !== null) ? this.generateMainMenuDescriptionWithTargetMode():this.generateMainMenuDescription() + const main = await ((gsed.gameSystem !== null && gsed.gameMode !== null) ? this.generateMainMenuDescriptionWithTargetMode():this.generateMainMenuDescription()) for (const generator of menuGenerators){ @@ -61,7 +61,7 @@ export class S_MainMenu this.deleteLoadingSpinner(); } - generateMainMenuDescription(){ + async generateMainMenuDescription(){ return this.articleDOM.appendChild(this.htmlConverter.elementWithoutEscaping`
@@ -70,7 +70,7 @@ export class S_MainMenu
Welcome to
Kirby-Speed/Score-Recorders!

-
ver ${this.app.version}
+
ver ${await this.app.version}

${context.description[0]} @@ -84,7 +84,7 @@ export class S_MainMenu `) as HTMLElement; } - generateMainMenuDescriptionWithTargetMode(){ + async generateMainMenuDescriptionWithTargetMode(){ const gsed = this.app.state.gameSystemEnvDisplayed const gameModeDescription = choiceDescription(gsed.gameMode,this.app.state.language) if (gsed.gameSystem === null || gsed.gameMode === null) throw new Error(`ゲームモードが設定されていません。`) @@ -95,7 +95,7 @@ export class S_MainMenu
${ `${gsed.gameSystem.English}/${gsed.gameMode.English}
Top Menu`}

-
ver ${this.app.version}
+
ver ${await this.app.version}


From bf1bf4f9b0a557c1517a5c47e9305fd19e9aede3 Mon Sep 17 00:00:00 2001 From: Appbird Date: Thu, 2 Sep 2021 15:15:41 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[fix]=20ver=20v2.x.x=E3=81=AE=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BD=99=E8=A8=88=E3=81=AAver=E3=81=8C?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7ver=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ts/client/view/state/mainMenu.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ts/client/view/state/mainMenu.ts b/src/ts/client/view/state/mainMenu.ts index 9a85949..3506fa3 100644 --- a/src/ts/client/view/state/mainMenu.ts +++ b/src/ts/client/view/state/mainMenu.ts @@ -70,7 +70,7 @@ export class S_MainMenu
Welcome to
Kirby-Speed/Score-Recorders!

-
ver ${await this.app.version}
+
${await this.app.version}

${context.description[0]} @@ -95,7 +95,7 @@ export class S_MainMenu
${ `${gsed.gameSystem.English}/${gsed.gameMode.English}
Top Menu`}

-
ver ${await this.app.version}
+
${await this.app.version}