fix: Prevent storybook from making websocket connections (#2896)

* feat: mock window.WebSocket to prevent WS calls from Main layout story

* Prettified Code!

---------

Co-authored-by: Pranav2612000 <Pranav2612000@users.noreply.github.com>
This commit is contained in:
Pranav Joglekar 2023-04-15 03:09:05 +05:30 committed by GitHub
parent 14277c15dd
commit cbdf0bd401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,10 @@ export default {
},
} satisfies ComponentMeta<typeof Main>;
// mock the Websocket to prevent ani webhook calls from being made in storybook
// @ts-ignore
window.WebSocket = () => {};
type StateInitializer = (mutableState: MutableSnapshot) => void;
const composeStateInitializers =