fix(tracker): fix peer hack for better build support

This commit is contained in:
sylenien 2022-06-27 17:23:37 +02:00 committed by Delirium
parent a03b441f97
commit bf80997c0c

View file

@ -15,7 +15,7 @@ import type { Options as ConfirmOptions } from './ConfirmWindow/defaults.js';
// TODO: fully specified strict check (everywhere)
//@ts-ignore peerjs hack for webpack5 (?!) TODO: ES/node modules;
Peer = Peer.default || Peer;
let PeerHack = Peer.default || Peer;
type StartEndCallback = () => ((()=>{}) | void)
@ -244,7 +244,7 @@ export default class Assist {
if (this.options.config) {
peerOptions['config'] = this.options.config
}
const peer = this.peer = new Peer(peerID, peerOptions);
const peer = this.peer = new PeerHack(peerID, peerOptions);
// app.debug.log('Peer created: ', peer)
peer.on('error', e => app.debug.warn("Peer error: ", e.type, e))
peer.on('disconnect', () => peer.reconnect())