replaced call socket() with apiOn/apiOff

This commit is contained in:
Jan Prochazka
2021-12-22 11:24:48 +01:00
parent 05ea435820
commit 2ace0bdb34
13 changed files with 41 additions and 46 deletions

View File

@@ -6,10 +6,9 @@
import WidgetsInnerContainer from '../widgets/WidgetsInnerContainer.svelte';
import FontIcon from '../icons/FontIcon.svelte';
import { onMount } from 'svelte';
import socket from '../utility/socket';
import openNewTab from '../utility/openNewTab';
import CloseSearchButton from '../elements/CloseSearchButton.svelte';
import { apiCall } from '../utility/api';
import { apiCall, apiOff, apiOn } from '../utility/api';
let filter = '';
let search = '';
@@ -31,9 +30,9 @@
$: setDebouncedFilter(filter);
onMount(() => {
socket().on('query-history-changed', reloadItems);
apiOn('query-history-changed', reloadItems);
return () => {
socket().off('query-history-changed', reloadItems);
apiOff('query-history-changed', reloadItems);
};
});
</script>