mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 01:55:59 +00:00
replaced call socket() with apiOn/apiOff
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import _ from 'lodash';
|
||||
import ErrorInfo from '../elements/ErrorInfo.svelte';
|
||||
import { apiOff, apiOn } from '../utility/api';
|
||||
import createRef from '../utility/createRef';
|
||||
|
||||
import socket from '../utility/socket';
|
||||
|
||||
import useEffect from '../utility/useEffect';
|
||||
|
||||
import MessageView from './MessageView.svelte';
|
||||
@@ -30,9 +29,9 @@
|
||||
|
||||
$: effect = useEffect(() => {
|
||||
if (eventName) {
|
||||
socket().on(eventName, handleInfo);
|
||||
apiOn(eventName, handleInfo);
|
||||
return () => {
|
||||
socket().off(eventName, handleInfo);
|
||||
apiOff(eventName, handleInfo);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
|
||||
Reference in New Issue
Block a user