Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/app/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import "core-js/stable";
require("zone.js/dist/zone");

// IE11 fix, ref: https://github.com/angular/angular/issues/24769
if (!Element.prototype.matches && (Element.prototype as any).msMatchesSelector) {
Element.prototype.matches = (Element.prototype as any).msMatchesSelector;
}

if (process.env.NODE_ENV === "production") {
// Production
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/app/send/access.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CryptoService } from "jslib-common/abstractions/crypto.service";
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { SEND_KDF_ITERATIONS } from "jslib-common/enums/kdfType";
import { SendType } from "jslib-common/enums/sendType";
import { Utils } from "jslib-common/misc/utils";
import { SendAccess } from "jslib-common/models/domain/sendAccess";
Expand Down Expand Up @@ -140,7 +141,7 @@ export class AccessComponent implements OnInit {
this.password,
keyArray,
"sha256",
100000
SEND_KDF_ITERATIONS
);
this.accessRequest.password = Utils.fromBufferToB64(passwordHash);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/settings/change-kdf.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="col-12">
<div class="form-group">
<div class="small form-text text-muted">
<p>{{ "kdfIterationsDesc" | i18n: (100000 | number) }}</p>
<p>{{ "kdfIterationsDesc" | i18n: (recommendedKdfIterations | number) }}</p>
<strong>{{ "warning" | i18n }}</strong
>: {{ "kdfIterationsWarning" | i18n: (50000 | number) }}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/settings/change-kdf.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LogService } from "jslib-common/abstractions/log.service";
import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { StateService } from "jslib-common/abstractions/state.service";
import { KdfType } from "jslib-common/enums/kdfType";
import { DEFAULT_KDF_ITERATIONS, KdfType } from "jslib-common/enums/kdfType";
import { KdfRequest } from "jslib-common/models/request/kdfRequest";

@Component({
Expand All @@ -20,6 +20,7 @@ export class ChangeKdfComponent implements OnInit {
kdf = KdfType.PBKDF2_SHA256;
kdfOptions: any[] = [];
formPromise: Promise<any>;
recommendedKdfIterations = DEFAULT_KDF_ITERATIONS;

constructor(
private apiService: ApiService,
Expand Down
31 changes: 12 additions & 19 deletions src/services/webPlatformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
return this.getDevice() === DeviceType.SafariBrowser;
}

isIE(): boolean {
return this.getDevice() === DeviceType.IEBrowser;
}

isMacAppStore(): boolean {
return false;
}
Expand Down Expand Up @@ -139,26 +135,23 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
blobOptions.type = type;
}
}
if (blobOptions != null && !this.isIE()) {
if (blobOptions != null) {
blob = new Blob([blobData], blobOptions);
} else {
blob = new Blob([blobData]);
}
if (navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, fileName);
} else {
const a = win.document.createElement("a");
if (doDownload) {
a.download = fileName;
} else if (!this.isSafari()) {
a.target = "_blank";
}
a.href = URL.createObjectURL(blob);
a.style.position = "fixed";
win.document.body.appendChild(a);
a.click();
win.document.body.removeChild(a);

const a = win.document.createElement("a");
if (doDownload) {
a.download = fileName;
} else if (!this.isSafari()) {
a.target = "_blank";
}
a.href = URL.createObjectURL(blob);
a.style.position = "fixed";
win.document.body.appendChild(a);
a.click();
win.document.body.removeChild(a);
}

getApplicationVersion(): Promise<string> {
Expand Down