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:
parent
701d795000
commit
d168d5ee9b
@ -2017,7 +2017,7 @@
|
||||
}
|
||||
},
|
||||
"lastSeenOn": {
|
||||
"message": "last seen on $DATE$",
|
||||
"message": "last seen on: $DATE$",
|
||||
"placeholders": {
|
||||
"date": {
|
||||
"content": "$1",
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user