app version is added

This commit is contained in:
Richard Park 2020-01-13 15:41:35 +09:00
parent 9561dcbe80
commit 34e8db65b4
9 changed files with 52 additions and 1 deletions

View File

@ -397,6 +397,13 @@ ipcMain.on(
}
);
ipcMain.on(
MessengerChannel.GetVersionInfo,
(event: IpcMainEvent, ...args: any[]) => {
event.returnValue = app.getVersion();
}
);
ipcMain.on(
MessengerChannel.ChangeAutoLaunch,
(event: IpcMainEvent, ...args: any[]) => {

View File

@ -306,6 +306,12 @@
</button>
</div>
<mat-divider></mat-divider>
<div class="setting">
<button mat-menu-item [matMenuTriggerFor]="informationMenu">
{{ 'information.label' | translate }}
</button>
</div>
<mat-divider></mat-divider>
<div class="setting">
<button mat-menu-item (click)="onClickLogout()">
{{ 'accounts.logout' | translate }}
@ -414,3 +420,9 @@
</div>
</mat-radio-group>
</mat-menu>
<mat-menu #informationMenu="matMenu">
<div mat-menu-item>
{{ 'information.version' | translate }}: {{ appVersion }}
</div>
</mat-menu>

View File

@ -93,6 +93,8 @@ export class TopBarComponent implements OnInit, OnDestroy {
webLinkBadgeMail = 0;
webLinkBadgePayment = 0;
appVersion: string;
WebLinkType = WebLinkType;
StatusCode = StatusCode;
@ -167,6 +169,10 @@ export class TopBarComponent implements OnInit, OnDestroy {
);
this.zoom = appUserInfo.zoom;
this.nativeService.getVersionInfo().then(ver => {
this.appVersion = ver;
});
}
ngOnDestroy(): void {

View File

@ -67,6 +67,10 @@
"failToChangeProfileImage": "Failed to change profile image."
}
},
"information": {
"label": "Information",
"version": "Version"
},
"settings": {
"label": "Settings",
"typeGenernal": "Genernal",

View File

@ -67,6 +67,10 @@
"failToChangeProfileImage": "프로필 이미지 변경에 실패 하였습니다."
}
},
"information": {
"label": "정보",
"version": "버전"
},
"settings": {
"label": "설정",
"typeGenernal": "일반",

View File

@ -78,6 +78,12 @@ export class BrowserNativeService extends NativeService {
});
}
getVersionInfo(): Promise<string> {
return new Promise<any>((resolve, reject) => {
resolve('');
});
}
changeAutoLaunch(autoLaunch: boolean): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
resolve(true);

View File

@ -90,6 +90,16 @@ export class ElectronNativeService implements NativeService {
});
}
getVersionInfo(): Promise<string> {
return new Promise<string>((resolve, reject) => {
try {
resolve(this.ipcRenderer.sendSync(MessengerChannel.GetVersionInfo));
} catch (error) {
reject(error);
}
});
}
changeStatus(): Observable<StatusCode> {
if (!this.changeStatusSubject) {
this.changeStatusSubject = new Subject<StatusCode>();

View File

@ -5,7 +5,8 @@ export enum MessengerChannel {
ChangeAutoLaunch = 'UCAP::messenger::changeAutoLaunch',
ChangeStartupHideWindow = 'UCAP::messenger::changeStartupHideWindow',
ChangeDownloadPath = 'UCAP::messenger::changeDownloadPath',
GetNetworkInfo = 'UCAP::messenger::getNetworkInfo'
GetNetworkInfo = 'UCAP::messenger::getNetworkInfo',
GetVersionInfo = 'UCAP::messenger::getVersionInfo'
}
export enum ChatChannel {

View File

@ -25,6 +25,7 @@ export abstract class NativeService {
abstract showSetting(): Observable<void>;
abstract getNetworkInfo(): Promise<any>;
abstract getVersionInfo(): Promise<string>;
abstract changeAutoLaunch(autoLaunch: boolean): Promise<boolean>;
abstract changeStartupHideWindow(