Merge pull request #60 from WardPearce/fix/watch-leave

Fixed disconnect not working
This commit is contained in:
Ward
2024-04-06 18:33:17 +13:00
committed by GitHub
+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;
}
});