mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
add different origin condition
This commit is contained in:
@@ -893,6 +893,9 @@ export const Group = ({
|
||||
useEffect(() => {
|
||||
// Handler function for incoming messages
|
||||
const messageHandler = (event) => {
|
||||
if (event.origin !== window.location.origin) {
|
||||
return;
|
||||
}
|
||||
const message = event.data;
|
||||
if (message?.action === "SET_GROUPS") {
|
||||
|
||||
|
@@ -107,7 +107,9 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => {
|
||||
}
|
||||
};
|
||||
|
||||
initWebsocketMessageGroup(); // Initialize WebSocket on component mount
|
||||
|
||||
initWebsocketMessageGroup(); // Initialize WebSocket on component mount
|
||||
|
||||
|
||||
return () => {
|
||||
forceCloseWebSocket(); // Clean up WebSocket on component unmount
|
||||
|
Reference in New Issue
Block a user