Unverified Commit a0fb72a1 authored by Licho's avatar Licho Committed by GitHub

feat: improve websocket connection and subcrib opportunity. (#1871)

parent 2ea701a4
......@@ -54,11 +54,10 @@ const DatePage = (props: any) => {
useEffect(() => {
return () => {
unRegisterWatchTable({id, table: tableName}).then(res => {
console.log("unsubscribe: " + tableName)
subScription?.unsubscribe();
});
}
}, []);
}, [subScription]);
const editorDidMountHandle = (editor: any, monaco: any) => {
onSearchName(title);
......@@ -83,7 +82,7 @@ const DatePage = (props: any) => {
};
const StudioData = (props: any) => {
const {height, isActive, current} = props;
const {height, current} = props;
const [panes, setPanes] = useState<[{ title: string, key: string, content: Component }]>([]);
const addTab = async () => {
......@@ -117,9 +116,6 @@ const StudioData = (props: any) => {
useEffect(() => {
stompClientUtil.connect();
}, [isActive])
useEffect(() => {
return () => {
stompClientUtil.disconnect();
}
......
import Stomp, { Subscription } from "stompjs";
import Stomp from "stompjs";
class StompClientUtil {
stompClient: Stomp.Client;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment