1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

Fix last seen & spacing issue (#3567)

* Fix last seen & spacing issue

* Address PR comments, moving try catch to config service
This commit is contained in:
Colton Hurst 2022-09-27 11:09:48 -04:00 committed by GitHub
parent 701d795000
commit d168d5ee9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 11 deletions

View File

@ -2017,7 +2017,7 @@
}
},
"lastSeenOn": {
"message": "last seen on $DATE$",
"message": "last seen on: $DATE$",
"placeholders": {
"date": {
"content": "$1",

View File

@ -14,7 +14,7 @@
<p class="text-center" *ngIf="isCloud">
{{ "serverVersion" | i18n }}: {{ this.serverConfig?.version }}
<span *ngIf="!serverConfig.isValid()">
({{ "lastSeenOn" | i18n }}: {{ serverConfig.utcDate | date: "mediumDate" }})
({{ "lastSeenOn" | i18n: (serverConfig.utcDate | date: "mediumDate") }})
</span>
</p>
@ -24,7 +24,7 @@
{{ "serverVersion" | i18n }} <small>({{ "thirdParty" | i18n }})</small>:
{{ this.serverConfig?.version }}
<span *ngIf="!serverConfig.isValid()">
({{ "lastSeenOn" | i18n }}: {{ serverConfig.utcDate | date: "mediumDate" }})
({{ "lastSeenOn" | i18n: (serverConfig.utcDate | date: "mediumDate") }})
</span>
</p>
<div class="text-center">
@ -36,7 +36,7 @@
{{ "serverVersion" | i18n }} <small>({{ "selfHosted" | i18n }})</small>:
{{ this.serverConfig?.version }}
<span *ngIf="!serverConfig.isValid()">
({{ "lastSeenOn" | i18n }}: {{ serverConfig.utcDate | date: "mediumDate" }})
({{ "lastSeenOn" | i18n: (serverConfig.utcDate | date: "mediumDate") }})
</span>
</p>
</ng-container>

View File

@ -48,14 +48,16 @@ export class ConfigService implements ConfigServiceAbstraction {
}
private async fetchServerConfig(): Promise<ServerConfig> {
const response = await this.configApiService.get();
const data = new ServerConfigData(response);
try {
const response = await this.configApiService.get();
if (data != null) {
await this.stateService.setServerConfig(data);
return new ServerConfig(data);
if (response != null) {
const data = new ServerConfigData(response);
await this.stateService.setServerConfig(data);
return new ServerConfig(data);
}
} catch {
return null;
}
return null;
}
}