fix: tab broadcast error at local

This commit is contained in:
Tristan Yang
2023-02-13 07:39:03 +08:00
parent 62b4c3ee72
commit e1fb1a929a
+1 -2
View File
@@ -6,11 +6,10 @@ type ChannelData = {
type: "NEW_TAB",
message: string
}
const channel = new BroadcastChannel('VOCECHAT_CHANNEL');
const useTabBroadcast = () => {
// const { stopStreaming } = useStreaming();
const [tabActive, setTabActive] = useState(true);
useEffect(() => {
const channel = new BroadcastChannel('VOCECHAT_CHANNEL');
channel.postMessage({ type: "NEW_TAB", message: "new tab opened" } as ChannelData);
const handler = (data: ChannelData) => {
console.log("channel data", data);