Skip to content

Commit

Permalink
Remove onStatus action delete
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax committed Nov 15, 2024
1 parent b9afb31 commit f595423
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/stores/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { clearErrorData } from "../utils/errorData";
import {
getParentId,
handleRedirectIfNotValid,
redirectToNotFoundErrorPage,
} from "../utils/redirectUtils";
import { getUserData } from "../utils/userData";
import { setDefaultState } from "../utils/userSettings";
Expand All @@ -34,21 +33,6 @@ const provider = new WebsocketProvider(
},
);

provider.on("status", (event: { status: string }) => {
if (!provider.ws?.onmessage || event.status !== "connected") return;

const originalOnMessage = provider.ws.onmessage.bind(provider.ws);

provider.ws.onmessage = (messageEvent) => {
if (messageEvent.data === "action:delete") {
provider.disconnect();
redirectToNotFoundErrorPage();
} else {
originalOnMessage(messageEvent);
}
};
});

const room = new Room<UserPresence>(provider.awareness, {});
const yShapes: Map<TDShape> = doc.getMap("shapes");
const yBindings: Map<TDBinding> = doc.getMap("bindings");
Expand Down

0 comments on commit f595423

Please sign in to comment.