Fixed disconnect not working

This commit is contained in:
WardPearce
2024-04-06 18:32:58 +13:00
parent 79bf970d3e
commit 6f567cad22
+2 -2
View File
@@ -120,7 +120,7 @@
const currentUrl = new URL(location.href);
if ($syncPartyPeer) {
$syncPartyPeer.disconnect();
$syncPartyPeer.destroy();
syncPartyPeer.set(null);
currentUrl.searchParams.delete('sync');
window.history.pushState({ path: currentUrl.toString() }, '', currentUrl.toString());
@@ -264,7 +264,7 @@
onDestroy(() => {
if ($syncPartyPeer) {
$syncPartyPeer.disconnect();
$syncPartyPeer.destroy();
$syncPartyPeer = null;
}
});