mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[bug] Always save environmentUrls passed to setUrls (#641)
* [bug] Always save environmentUrls passed to setUrls * [bug] Remove parameter from abstraction as well * [bug] Correct type in abstraction
This commit is contained in:
@@ -29,6 +29,6 @@ export abstract class EnvironmentService {
|
|||||||
getEventsUrl: () => string;
|
getEventsUrl: () => string;
|
||||||
getKeyConnectorUrl: () => string;
|
getKeyConnectorUrl: () => string;
|
||||||
setUrlsFromStorage: () => Promise<void>;
|
setUrlsFromStorage: () => Promise<void>;
|
||||||
setUrls: (urls: any, saveSettings?: boolean) => Promise<Urls>;
|
setUrls: (urls: Urls) => Promise<Urls>;
|
||||||
getUrls: () => Urls;
|
getUrls: () => Urls;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
|||||||
this.keyConnectorUrl = urls.keyConnector;
|
this.keyConnectorUrl = urls.keyConnector;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setUrls(urls: Urls, saveSettings: boolean = true): Promise<any> {
|
async setUrls(urls: Urls): Promise<any> {
|
||||||
urls.base = this.formatUrl(urls.base);
|
urls.base = this.formatUrl(urls.base);
|
||||||
urls.webVault = this.formatUrl(urls.webVault);
|
urls.webVault = this.formatUrl(urls.webVault);
|
||||||
urls.api = this.formatUrl(urls.api);
|
urls.api = this.formatUrl(urls.api);
|
||||||
@@ -136,7 +136,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
|||||||
urls.events = this.formatUrl(urls.events);
|
urls.events = this.formatUrl(urls.events);
|
||||||
urls.keyConnector = this.formatUrl(urls.keyConnector);
|
urls.keyConnector = this.formatUrl(urls.keyConnector);
|
||||||
|
|
||||||
if (saveSettings) {
|
|
||||||
await this.stateService.setEnvironmentUrls({
|
await this.stateService.setEnvironmentUrls({
|
||||||
base: urls.base,
|
base: urls.base,
|
||||||
api: urls.api,
|
api: urls.api,
|
||||||
@@ -147,7 +146,6 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
|
|||||||
events: urls.events,
|
events: urls.events,
|
||||||
keyConnector: urls.keyConnector,
|
keyConnector: urls.keyConnector,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
this.baseUrl = urls.base;
|
this.baseUrl = urls.base;
|
||||||
this.webVaultUrl = urls.webVault;
|
this.webVaultUrl = urls.webVault;
|
||||||
|
|||||||
Reference in New Issue
Block a user