mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 23:36:17 -04:00
replace javascript operators ??
and ?.
to support older browsers (see #79)
This commit is contained in:
parent
5a290718b6
commit
4e0fb89720
4 changed files with 22 additions and 8 deletions
|
@ -107,8 +107,15 @@ class PeersUI {
|
|||
_getSavedDisplayName() {
|
||||
return new Promise((resolve) => {
|
||||
PersistentStorage.get('editedDisplayName')
|
||||
.then(displayName => resolve(displayName ?? ""))
|
||||
.catch(_ => resolve(localStorage.getItem('editedDisplayName') ?? ""))
|
||||
.then(displayName => {
|
||||
if (!displayName) displayName = "";
|
||||
resolve(displayName);
|
||||
})
|
||||
.catch(_ => {
|
||||
let displayName = localStorage.getItem('editedDisplayName');
|
||||
if (!displayName) displayName = "";
|
||||
resolve(displayName);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -826,7 +833,7 @@ class ReceiveRequestDialog extends ReceiveDialog {
|
|||
const connectionHash = $(peerId).ui._connectionHash;
|
||||
this._parseFileData(displayName, connectionHash, request.header, request.imagesOnly, request.totalSize);
|
||||
|
||||
if (request.thumbnailDataUrl?.substring(0, 22) === "data:image/jpeg;base64") {
|
||||
if (request.thumbnailDataUrl && request.thumbnailDataUrl.substring(0, 22) === "data:image/jpeg;base64") {
|
||||
let element = document.createElement('img');
|
||||
element.src = request.thumbnailDataUrl;
|
||||
this.$previewBox.appendChild(element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue