fix code style

This commit is contained in:
syuilo 2023-11-05 08:29:50 +09:00
parent 1876f7d5ff
commit f2953e6205
1 changed files with 10 additions and 8 deletions

View File

@ -88,7 +88,8 @@ let connection2: Connection;
let paginationQuery: Paging | null = null; let paginationQuery: Paging | null = null;
const stream = useStream(); const stream = useStream();
const connectChannel = () => {
function connectChannel() {
if (props.src === 'antenna') { if (props.src === 'antenna') {
connection = stream.useChannel('antenna', { connection = stream.useChannel('antenna', {
antennaId: props.antenna, antennaId: props.antenna,
@ -142,14 +143,14 @@ const connectChannel = () => {
}); });
} }
if (props.src !== 'directs' || props.src !== 'mentions') connection.on('note', prepend); if (props.src !== 'directs' || props.src !== 'mentions') connection.on('note', prepend);
}; }
const disconnectChannel = () => { function disconnectChannel() {
if (connection) connection.dispose(); if (connection) connection.dispose();
if (connection2) connection2.dispose(); if (connection2) connection2.dispose();
}; }
const updatePaginationQuery = () => { function updatePaginationQuery() {
let endpoint: string | null; let endpoint: string | null;
let query: TimelineQueryType | null; let query: TimelineQueryType | null;
@ -222,16 +223,17 @@ const updatePaginationQuery = () => {
} else { } else {
paginationQuery = null; paginationQuery = null;
} }
}; }
const refreshEndpointAndChannel = () => { function refreshEndpointAndChannel() {
console.log('refreshEndpointAndChannel');
if (!defaultStore.state.disableStreamingTimeline) { if (!defaultStore.state.disableStreamingTimeline) {
disconnectChannel(); disconnectChannel();
connectChannel(); connectChannel();
} }
updatePaginationQuery(); updatePaginationQuery();
}; }
onUnmounted(() => { onUnmounted(() => {
disconnectChannel(); disconnectChannel();