Skip to content

Commit

Permalink
feat: Use BRAND_NAME in filename for backup and call report (#8367)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yserz committed Mar 16, 2020
1 parent 1253a7e commit 041ffb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/script/view_model/content/HistoryExportViewModel.js
Expand Up @@ -27,6 +27,7 @@ import {EventName} from '../../tracking/EventName';
import {ContentViewModel} from '../ContentViewModel';

import 'Components/loadingBar';
import {Config} from '../../Config';

window.z = window.z || {};
window.z.viewModel = z.viewModel || {};
Expand Down Expand Up @@ -122,7 +123,8 @@ z.viewModel.content.HistoryExportViewModel = class HistoryExportViewModel {
downloadArchiveFile() {
const userName = this.userRepository.self().username();
const fileExtension = HistoryExportViewModel.CONFIG.FILE_EXTENSION;
const filename = `Wire-${userName}-Backup_${getCurrentDate()}.${fileExtension}`;
const sanitizedBrandName = Config.getConfig().BRAND_NAME.replace(/[^A-Za-z0-9_]/g, '');
const filename = `${sanitizedBrandName}-${userName}-Backup_${getCurrentDate()}.${fileExtension}`;

this.dismissExport();
downloadBlob(this.archiveBlob(), filename, 'application/octet-stream');
Expand Down
3 changes: 2 additions & 1 deletion src/script/view_model/content/PreferencesOptionsViewModel.js
Expand Up @@ -100,7 +100,8 @@ z.viewModel.content.PreferencesOptionsViewModel = class PreferencesOptionsViewMo

const selfUserId = this.userRepository.self().id;
const truncatedId = selfUserId.substr(0, PreferencesOptionsViewModel.CONFIG.OBFUSCATION_TRUNCATE_TO);
const filename = `Wire-${truncatedId}-Calling_${getCurrentDate()}.log`;
const sanitizedBrandName = Config.getConfig().BRAND_NAME.replace(/[^A-Za-z0-9_]/g, '');
const filename = `${sanitizedBrandName}-${truncatedId}-Calling_${getCurrentDate()}.log`;

return downloadBlob(blob, filename);
}
Expand Down

0 comments on commit 041ffb9

Please sign in to comment.