mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 12:59:14 +00:00
Update widget/src/providers/BroadcastChannelProvider.tsx
This commit is contained in:
parent
a1b9bfcba0
commit
c5f61d1d3a
@ -136,7 +136,7 @@ export const BroadcastChannelProvider: FC<IBroadcastChannelProps> = ({
|
|||||||
export const useBroadcastChannel = () => {
|
export const useBroadcastChannel = () => {
|
||||||
const context = useContext(BroadcastChannelContext);
|
const context = useContext(BroadcastChannelContext);
|
||||||
|
|
||||||
if (context === undefined) {
|
if (!context) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"useBroadcastChannel must be used within a BroadcastChannelProvider",
|
"useBroadcastChannel must be used within a BroadcastChannelProvider",
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user