increase version to v1.7.6

This commit is contained in:
Thomas Egger 2023-06-01 10:59:30 +02:00
parent 40f7f9b6a2
commit 961e81a187
9 changed files with 33 additions and 30 deletions

View File

@ -219,10 +219,15 @@ class MoreLoadServer {
} }
_onDisconnect(sender) { _onDisconnect(sender) {
this._disconnect(sender);
}
_disconnect(sender) {
this._leaveRoom(sender, 'ip', '', true); this._leaveRoom(sender, 'ip', '', true);
this._leaveAllSecretRooms(sender, true); this._leaveAllSecretRooms(sender, true);
this._removeRoomKey(sender.roomKey); this._removeRoomKey(sender.roomKey);
sender.roomKey = null; sender.roomKey = null;
sender.socket.terminate();
} }
_onRoomSecrets(sender, message) { _onRoomSecrets(sender, message) {
@ -358,6 +363,7 @@ class MoreLoadServer {
const room = roomType === 'ip' ? peer.ip : roomSecret; const room = roomType === 'ip' ? peer.ip : roomSecret;
if (this._rooms[room] && this._rooms[room][peer.id]) { 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); this._leaveRoom(peer, roomType, roomSecret);
} }
@ -385,10 +391,6 @@ class MoreLoadServer {
// delete the peer // delete the peer
delete this._rooms[room][peer.id]; delete this._rooms[room][peer.id];
if (roomType === 'ip') {
peer.socket.terminate();
}
//if room is empty, delete the room //if room is empty, delete the room
if (!Object.keys(this._rooms[room]).length) { if (!Object.keys(this._rooms[room]).length) {
delete this._rooms[room]; delete this._rooms[room];
@ -468,8 +470,7 @@ class MoreLoadServer {
peer.lastBeat = Date.now(); peer.lastBeat = Date.now();
} }
if (Date.now() - peer.lastBeat > 2 * timeout) { if (Date.now() - peer.lastBeat > 2 * timeout) {
this._leaveRoom(peer); this._disconnect(peer);
this._leaveAllSecretRooms(peer);
return; return;
} }
@ -726,4 +727,4 @@ const cyrb53 = function(str, seed = 0) {
return 4294967296 * (2097151 & h2) + (h1>>>0); return 4294967296 * (2097151 & h2) + (h1>>>0);
}; };
new MoreLoadServer(); new MoreLoadServer();

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "moreload", "name": "moreload",
"version": "1.7.4", "version": "1.7.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "moreload", "name": "moreload",
"version": "1.7.4", "version": "1.7.6",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"express": "^4.18.2", "express": "^4.18.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "moreload", "name": "moreload",
"version": "1.7.4", "version": "1.7.6",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -278,7 +278,7 @@
</svg> </svg>
<div class="title-wrapper"> <div class="title-wrapper">
<h1>MoreLoad</h1> <h1>MoreLoad</h1>
<div class="font-subheading">v1.7.4</div> <div class="font-subheading">v1.7.6</div>
</div> </div>
<div class="font-subheading">The easiest way to transfer files across devices</div> <div class="font-subheading">The easiest way to transfer files across devices</div>
<div class="row"> <div class="row">

View File

@ -1296,13 +1296,13 @@ class SendTextDialog extends Dialog {
} }
async _onKeyDown(e) { async _onKeyDown(e) {
if (this.isShown()) { if (!this.isShown()) return;
if (e.code === "Escape") {
this.hide(); if (e.code === "Escape") {
} else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) { this.hide();
if (this._textInputEmpty()) return; } else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
this._send(); if (this._textInputEmpty()) return;
} this._send();
} }
} }
@ -1420,7 +1420,8 @@ class ReceiveTextDialog extends Dialog {
} }
async _onCopy() { 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'); Events.fire('notify-user', 'Copied to clipboard');
this.hide(); this.hide();
} }

View File

@ -1,4 +1,4 @@
const cacheVersion = 'v1.7.4'; const cacheVersion = 'v1.7.6';
const cacheTitle = `moreload-cache-${cacheVersion}`; const cacheTitle = `moreload-cache-${cacheVersion}`;
const urlsToCache = [ const urlsToCache = [
'index.html', 'index.html',

View File

@ -281,7 +281,7 @@
</svg> </svg>
<div class="title-wrapper"> <div class="title-wrapper">
<h1>MoreLoad</h1> <h1>MoreLoad</h1>
<div class="font-subheading">v1.7.4</div> <div class="font-subheading">v1.7.6</div>
</div> </div>
<div class="font-subheading">The easiest way to transfer files across devices</div> <div class="font-subheading">The easiest way to transfer files across devices</div>
<div class="row"> <div class="row">

View File

@ -1297,13 +1297,13 @@ class SendTextDialog extends Dialog {
} }
async _onKeyDown(e) { async _onKeyDown(e) {
if (this.isShown()) { if (!this.isShown()) return;
if (e.code === "Escape") {
this.hide(); if (e.code === "Escape") {
} else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) { this.hide();
if (this._textInputEmpty()) return; } else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) {
this._send(); if (this._textInputEmpty()) return;
} this._send();
} }
} }
@ -1421,7 +1421,8 @@ class ReceiveTextDialog extends Dialog {
} }
async _onCopy() { 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'); Events.fire('notify-user', 'Copied to clipboard');
this.hide(); this.hide();
} }

View File

@ -1,4 +1,4 @@
const cacheVersion = 'v1.7.4'; const cacheVersion = 'v1.7.6';
const cacheTitle = `moreload-included-ws-fallback-cache-${cacheVersion}`; const cacheTitle = `moreload-included-ws-fallback-cache-${cacheVersion}`;
const urlsToCache = [ const urlsToCache = [
'index.html', 'index.html',