increase version to v1.7.6
This commit is contained in:
parent
40f7f9b6a2
commit
961e81a187
15
index.js
15
index.js
|
@ -219,10 +219,15 @@ class MoreLoadServer {
|
|||
}
|
||||
|
||||
_onDisconnect(sender) {
|
||||
this._disconnect(sender);
|
||||
}
|
||||
|
||||
_disconnect(sender) {
|
||||
this._leaveRoom(sender, 'ip', '', true);
|
||||
this._leaveAllSecretRooms(sender, true);
|
||||
this._removeRoomKey(sender.roomKey);
|
||||
sender.roomKey = null;
|
||||
sender.socket.terminate();
|
||||
}
|
||||
|
||||
_onRoomSecrets(sender, message) {
|
||||
|
@ -358,6 +363,7 @@ class MoreLoadServer {
|
|||
const room = roomType === 'ip' ? peer.ip : roomSecret;
|
||||
|
||||
if (this._rooms[room] && this._rooms[room][peer.id]) {
|
||||
// ensures that otherPeers never receive `peer-left` after `peer-joined` on reconnect.
|
||||
this._leaveRoom(peer, roomType, roomSecret);
|
||||
}
|
||||
|
||||
|
@ -385,10 +391,6 @@ class MoreLoadServer {
|
|||
// delete the peer
|
||||
delete this._rooms[room][peer.id];
|
||||
|
||||
if (roomType === 'ip') {
|
||||
peer.socket.terminate();
|
||||
}
|
||||
|
||||
//if room is empty, delete the room
|
||||
if (!Object.keys(this._rooms[room]).length) {
|
||||
delete this._rooms[room];
|
||||
|
@ -468,8 +470,7 @@ class MoreLoadServer {
|
|||
peer.lastBeat = Date.now();
|
||||
}
|
||||
if (Date.now() - peer.lastBeat > 2 * timeout) {
|
||||
this._leaveRoom(peer);
|
||||
this._leaveAllSecretRooms(peer);
|
||||
this._disconnect(peer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -726,4 +727,4 @@ const cyrb53 = function(str, seed = 0) {
|
|||
return 4294967296 * (2097151 & h2) + (h1>>>0);
|
||||
};
|
||||
|
||||
new MoreLoadServer();
|
||||
new MoreLoadServer();
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "moreload",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "moreload",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.6",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "moreload",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.6",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -278,7 +278,7 @@
|
|||
</svg>
|
||||
<div class="title-wrapper">
|
||||
<h1>MoreLoad</h1>
|
||||
<div class="font-subheading">v1.7.4</div>
|
||||
<div class="font-subheading">v1.7.6</div>
|
||||
</div>
|
||||
<div class="font-subheading">The easiest way to transfer files across devices</div>
|
||||
<div class="row">
|
||||
|
|
|
@ -1296,13 +1296,13 @@ class SendTextDialog extends Dialog {
|
|||
}
|
||||
|
||||
async _onKeyDown(e) {
|
||||
if (this.isShown()) {
|
||||
if (e.code === "Escape") {
|
||||
this.hide();
|
||||
} else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
|
||||
if (this._textInputEmpty()) return;
|
||||
this._send();
|
||||
}
|
||||
if (!this.isShown()) return;
|
||||
|
||||
if (e.code === "Escape") {
|
||||
this.hide();
|
||||
} else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
|
||||
if (this._textInputEmpty()) return;
|
||||
this._send();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1420,7 +1420,8 @@ class ReceiveTextDialog extends Dialog {
|
|||
}
|
||||
|
||||
async _onCopy() {
|
||||
await navigator.clipboard.writeText(this.$text.innerText);
|
||||
const sanitizedText = this.$text.innerText.replace(/\u00A0/gm, ' ');
|
||||
await navigator.clipboard.writeText(sanitizedText);
|
||||
Events.fire('notify-user', 'Copied to clipboard');
|
||||
this.hide();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const cacheVersion = 'v1.7.4';
|
||||
const cacheVersion = 'v1.7.6';
|
||||
const cacheTitle = `moreload-cache-${cacheVersion}`;
|
||||
const urlsToCache = [
|
||||
'index.html',
|
||||
|
|
|
@ -281,7 +281,7 @@
|
|||
</svg>
|
||||
<div class="title-wrapper">
|
||||
<h1>MoreLoad</h1>
|
||||
<div class="font-subheading">v1.7.4</div>
|
||||
<div class="font-subheading">v1.7.6</div>
|
||||
</div>
|
||||
<div class="font-subheading">The easiest way to transfer files across devices</div>
|
||||
<div class="row">
|
||||
|
|
|
@ -1297,13 +1297,13 @@ class SendTextDialog extends Dialog {
|
|||
}
|
||||
|
||||
async _onKeyDown(e) {
|
||||
if (this.isShown()) {
|
||||
if (e.code === "Escape") {
|
||||
this.hide();
|
||||
} else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
|
||||
if (this._textInputEmpty()) return;
|
||||
this._send();
|
||||
}
|
||||
if (!this.isShown()) return;
|
||||
|
||||
if (e.code === "Escape") {
|
||||
this.hide();
|
||||
} else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
|
||||
if (this._textInputEmpty()) return;
|
||||
this._send();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1421,7 +1421,8 @@ class ReceiveTextDialog extends Dialog {
|
|||
}
|
||||
|
||||
async _onCopy() {
|
||||
await navigator.clipboard.writeText(this.$text.innerText);
|
||||
const sanitizedText = this.$text.innerText.replace(/\u00A0/gm, ' ');
|
||||
await navigator.clipboard.writeText(sanitizedText);
|
||||
Events.fire('notify-user', 'Copied to clipboard');
|
||||
this.hide();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const cacheVersion = 'v1.7.4';
|
||||
const cacheVersion = 'v1.7.6';
|
||||
const cacheTitle = `moreload-included-ws-fallback-cache-${cacheVersion}`;
|
||||
const urlsToCache = [
|
||||
'index.html',
|
||||
|
|
Loading…
Reference in New Issue