fix code style
This commit is contained in:
parent
1876f7d5ff
commit
f2953e6205
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue