diff --git a/apps/web/src/utils/exportUtils/Exporter.ts b/apps/web/src/utils/exportUtils/Exporter.ts index 185507e8cc..1c535db5d4 100644 --- a/apps/web/src/utils/exportUtils/Exporter.ts +++ b/apps/web/src/utils/exportUtils/Exporter.ts @@ -56,7 +56,7 @@ export default abstract class Exporter { } public get destinationFileName(): string { - return this.makeFileNameNoExtension(SdkConfig.get().brand) + ".zip"; + return this.makeFileNameNoExtension() + ".zip"; } protected onBeforeUnload(this: void, e: BeforeUnloadEvent): string { @@ -77,12 +77,12 @@ export default abstract class Exporter { this.files.push(file); } - protected makeFileNameNoExtension(brand = "matrix"): string { + protected makeFileNameNoExtension(): string { // First try to use the real name of the room, then a translated copy of a generic name, // then finally hardcoded default to guarantee we'll have a name. const safeRoomName = sanitizeFilename(this.room.name ?? _t("common|unnamed_room")).trim() || "Unnamed Room"; const safeDate = formatFullDateNoDayISO(new Date()).replace(/:/g, "-"); // ISO format automatically removes a lot of stuff for us - const safeBrand = sanitizeFilename(brand); + const safeBrand = sanitizeFilename(SdkConfig.get().brand); return `${safeBrand} - ${safeRoomName} - Chat Export - ${safeDate}`; } diff --git a/apps/web/test/unit-tests/utils/exportUtils/JSONExport-test.ts b/apps/web/test/unit-tests/utils/exportUtils/JSONExport-test.ts index 9cc071b4e2..94cfeb08fc 100644 --- a/apps/web/test/unit-tests/utils/exportUtils/JSONExport-test.ts +++ b/apps/web/test/unit-tests/utils/exportUtils/JSONExport-test.ts @@ -16,7 +16,7 @@ describe("JSONExport", () => { jest.setSystemTime(REPEATABLE_DATE); }); - it("should have a Matrix-branded destination file name", () => { + it("should have an Element-branded destination file name", () => { const roomName = "My / Test / Room: Welcome"; const client = createTestClient(); const stubOptions: IExportOptions = { diff --git a/apps/web/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts b/apps/web/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts index 006e86b3bf..355e73c30a 100644 --- a/apps/web/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts +++ b/apps/web/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts @@ -34,7 +34,7 @@ describe("PlainTextExport", () => { stubRoom = mkStubRoom("!myroom:example.org", roomName, client); }); - it("should have a Matrix-branded destination file name", () => { + it("should have an Element-branded destination file name", () => { const exporter = new PlainTextExporter(stubRoom, ExportType.Timeline, stubOptions, () => {}); expect(exporter.destinationFileName).toMatchSnapshot(); diff --git a/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/JSONExport-test.ts.snap b/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/JSONExport-test.ts.snap index b8d2c3ce18..70410b2b24 100644 --- a/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/JSONExport-test.ts.snap +++ b/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/JSONExport-test.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing -exports[`JSONExport should have a Matrix-branded destination file name 1`] = `"matrix - My Test Room Welcome - Chat Export - 2022-11-17T16-58-32.517Z.json"`; +exports[`JSONExport should have an Element-branded destination file name 1`] = `"Element - My Test Room Welcome - Chat Export - 2022-11-17T16-58-32.517Z.json"`; diff --git a/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/PlainTextExport-test.ts.snap b/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/PlainTextExport-test.ts.snap index de3cff0d55..6c9f5ab29d 100644 --- a/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/PlainTextExport-test.ts.snap +++ b/apps/web/test/unit-tests/utils/exportUtils/__snapshots__/PlainTextExport-test.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing -exports[`PlainTextExport should have a Matrix-branded destination file name 1`] = `"matrix - My Test Room Welcome - Chat Export - 2022-11-17T16-58-32.517Z.txt"`; +exports[`PlainTextExport should have an Element-branded destination file name 1`] = `"Element - My Test Room Welcome - Chat Export - 2022-11-17T16-58-32.517Z.txt"`;