mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-23 16:26:17 -04:00
do not hide ReceiveDialogs on disconnect
This commit is contained in:
parent
8d2bbc795d
commit
bef7459019
2 changed files with 5 additions and 7 deletions
|
@ -8,9 +8,7 @@ class ServerConnection {
|
|||
Events.on('beforeunload', _ => this._disconnect());
|
||||
Events.on('pagehide', _ => this._disconnect());
|
||||
document.addEventListener('visibilitychange', _ => this._onVisibilityChange());
|
||||
if (navigator.connection) {
|
||||
navigator.connection.addEventListener('change', _ => this._disconnect());
|
||||
}
|
||||
if (navigator.connection) navigator.connection.addEventListener('change', _ => this._disconnect());
|
||||
Events.on('reconnect', _ => this._reconnect());
|
||||
Events.on('room-secrets', e => this._sendRoomSecrets(e.detail));
|
||||
Events.on('room-secret-deleted', e => this.send({ type: 'room-secret-deleted', roomSecret: e.detail}));
|
||||
|
|
|
@ -391,11 +391,11 @@ class PeerUI {
|
|||
|
||||
|
||||
class Dialog {
|
||||
constructor(id) {
|
||||
constructor(id, hideOnDisconnect = true) {
|
||||
this.$el = $(id);
|
||||
this.$el.querySelectorAll('[close]').forEach(el => el.addEventListener('click', _ => this.hide()))
|
||||
this.$autoFocus = this.$el.querySelector('[autofocus]');
|
||||
Events.on('ws-disconnected', _ => this.hide());
|
||||
if (hideOnDisconnect) Events.on('ws-disconnected', _ => this.hide());
|
||||
}
|
||||
|
||||
show() {
|
||||
|
@ -415,7 +415,7 @@ class Dialog {
|
|||
class ReceiveDialog extends Dialog {
|
||||
|
||||
constructor() {
|
||||
super('receiveDialog');
|
||||
super('receiveDialog', false);
|
||||
Events.on('file-received', e => {
|
||||
this._nextFile(e.detail);
|
||||
window.blop.play();
|
||||
|
@ -802,7 +802,7 @@ class SendTextDialog extends Dialog {
|
|||
|
||||
class ReceiveTextDialog extends Dialog {
|
||||
constructor() {
|
||||
super('receiveTextDialog');
|
||||
super('receiveTextDialog', false);
|
||||
Events.on('text-received', e => this._onText(e.detail))
|
||||
this.$text = this.$el.querySelector('#text');
|
||||
const copy = this.$el.querySelector('#copy');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue