diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe0cd99d5..c2236f0e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ * Cannot upload files to file group in govt cloud [\#1557](https://github.com/Azure/BatchExplorer/issues/1557) * Cannot login to GOVT cloud [\#1548](https://github.com/Azure/BatchExplorer/issues/1548) * Pricing broken, due to api breaking change [\#1562](https://github.com/Azure/BatchExplorer/issues/1562) +* Opening BatchExplorer in Govt cloud opens 2 application windows [\#1561](https://github.com/Azure/BatchExplorer/issues/1561) +* Not persisting the last login and the last selected cloud [\#1542](https://github.com/Azure/BatchExplorer/issues/1542) +* Caching issue on national clouds [\#1559](https://github.com/Azure/BatchExplorer/issues/1559) # 0.17.1 [All items](https://github.com/Azure/BatchExplorer/milestone/25?closed=1) diff --git a/app/components/common/download-folder-dialog/download-folder-dialog.component.ts b/app/components/common/download-folder-dialog/download-folder-dialog.component.ts index f41f08015e..51cdba4e14 100644 --- a/app/components/common/download-folder-dialog/download-folder-dialog.component.ts +++ b/app/components/common/download-folder-dialog/download-folder-dialog.component.ts @@ -141,7 +141,7 @@ export class DownloadFolderComponent { } private get _defaultDownloadFolder() { - return path.join(this.fs.commonFolders.downloads, "batch-labs"); + return path.join(this.fs.commonFolders.downloads, "batch-explorer"); } private _getSubdirectoryPath(filePath: string) { diff --git a/app/services/azure-batch/core/batch-http.service.ts b/app/services/azure-batch/core/batch-http.service.ts index 3736131bda..859aaad3f9 100644 --- a/app/services/azure-batch/core/batch-http.service.ts +++ b/app/services/azure-batch/core/batch-http.service.ts @@ -60,7 +60,8 @@ export class AzureBatchHttpService extends HttpService { } options.headers = (options.headers as any) - .set("Content-Type", "application/json; odata=minimalmetadata; charset=utf-8"); + .set("Content-Type", "application/json; odata=minimalmetadata; charset=utf-8") + .set("Cache-Control", "no-cache"); return options; } diff --git a/package-lock.json b/package-lock.json index 2a6aaf2416..7c3be60141 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "batch-labs", + "name": "batch-explorer", "version": "0.17.3", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index 727170260c..9d01215a9a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "batch-labs", + "name": "batch-explorer", "productName": "Batch Explorer", "description": "Batch Explorer is a tool to manage your Azure Batch accounts", "repository": { diff --git a/src/client/core/batch-explorer-application.ts b/src/client/core/batch-explorer-application.ts index 48efd2447d..05286a7b15 100644 --- a/src/client/core/batch-explorer-application.ts +++ b/src/client/core/batch-explorer-application.ts @@ -139,7 +139,8 @@ export class BatchExplorerApplication { */ public async updateAzureEnvironment(env: AzureEnvironment) { await this.aadService.logout(); - this.localStorage.setItem(Constants.localStorageKey.azureEnvironment, env.id); + this.windows.closeAll(); + await this.localStorage.setItem(Constants.localStorageKey.azureEnvironment, env.id); this._azureEnvironment.next(env); await this.aadService.login(); this.windows.openNewWindow(); diff --git a/src/client/core/local-data-store.ts b/src/client/core/local-data-store.ts index 30e74fbbdf..cd0835515d 100644 --- a/src/client/core/local-data-store.ts +++ b/src/client/core/local-data-store.ts @@ -47,6 +47,10 @@ export class LocalDataStore extends InMemoryDataStore implements DataStore { } private async _save(): Promise { - await this.localFileStorage.set(fileKey, this._data); + const obj = {}; + for (const [key, value] of this._data.entries()) { + obj[key] = value; + } + await this.localFileStorage.set(fileKey, obj); } } diff --git a/src/client/core/unique-window.ts b/src/client/core/unique-window.ts index 47f857b3d9..b1d314c320 100644 --- a/src/client/core/unique-window.ts +++ b/src/client/core/unique-window.ts @@ -48,9 +48,6 @@ export abstract class GenericWindow { * @param focus If we should focus on the window if it is already visible. @default false */ public show(focus: boolean = false) { - if (!this._window) { - this.create(); - } if (focus || !this._window.isVisible()) { this._window.show(); } @@ -101,4 +98,15 @@ export abstract class UniqueWindow extends GenericWindow { this.batchExplorerApp.quit(); }); } + + /** + * Display the window only if not already visible + * @param focus If we should focus on the window if it is already visible. @default false + */ + public show(focus: boolean = false) { + if (!this._window) { + this.create(); + } + super.show(focus); + } } diff --git a/src/client/main.ts b/src/client/main.ts index b3c3db05c0..e1aa109553 100644 --- a/src/client/main.ts +++ b/src/client/main.ts @@ -15,7 +15,7 @@ import "./init"; // 2. Update electron user data folder import { app } from "electron"; -app.setPath("userData", path.join(app.getPath("appData"), "batch-labs")); +app.setPath("userData", path.join(app.getPath("appData"), "BatchExplorer")); // 3. Initialize the logger import { initLogger } from "client/logger";