wip
This commit is contained in:
parent
7246f6529f
commit
d309ca1244
|
@ -106,7 +106,7 @@ type TimelineQueryType = {
|
||||||
roleId?: string
|
roleId?: string
|
||||||
};
|
};
|
||||||
|
|
||||||
let noteCounterForAd = 0;
|
let adInsertionCounter = 0;
|
||||||
|
|
||||||
const POLLING_INTERVAL = 1000 * 15;
|
const POLLING_INTERVAL = 1000 * 15;
|
||||||
|
|
||||||
|
@ -128,9 +128,9 @@ function releaseQueue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepend(note: Misskey.entities.Note) {
|
function prepend(note: Misskey.entities.Note) {
|
||||||
noteCounterForAd++;
|
adInsertionCounter++;
|
||||||
|
|
||||||
if (instance.notesPerOneAd > 0 && noteCounterForAd % instance.notesPerOneAd === 0) {
|
if (instance.notesPerOneAd > 0 && adInsertionCounter % instance.notesPerOneAd === 0) {
|
||||||
note._shouldInsertAd_ = true;
|
note._shouldInsertAd_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ onUnmounted(() => {
|
||||||
|
|
||||||
function reloadTimeline() {
|
function reloadTimeline() {
|
||||||
return new Promise<void>((res) => {
|
return new Promise<void>((res) => {
|
||||||
noteCounterForAd = 0;
|
adInsertionCounter = 0;
|
||||||
|
|
||||||
paginator.reload().then(() => {
|
paginator.reload().then(() => {
|
||||||
res();
|
res();
|
||||||
|
|
|
@ -73,6 +73,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { computed, watch, ref } from 'vue';
|
import { computed, watch, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { url } from '@@/js/config.js';
|
import { url } from '@@/js/config.js';
|
||||||
|
import { useInterval } from '@@/js/use-interval.js';
|
||||||
import type { PageHeaderItem } from '@/types/page-header.js';
|
import type { PageHeaderItem } from '@/types/page-header.js';
|
||||||
import MkPostForm from '@/components/MkPostForm.vue';
|
import MkPostForm from '@/components/MkPostForm.vue';
|
||||||
import MkTimeline from '@/components/MkTimeline.vue';
|
import MkTimeline from '@/components/MkTimeline.vue';
|
||||||
|
@ -118,6 +119,14 @@ const featuredPagination = computed(() => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
useInterval(() => {
|
||||||
|
if (channel.value == null) return;
|
||||||
|
miLocalStorage.setItemAsJson(`channelLastReadedAt:${channel.value.id}`, Date.now());
|
||||||
|
}, 3000, {
|
||||||
|
immediate: true,
|
||||||
|
afterMounted: true,
|
||||||
|
});
|
||||||
|
|
||||||
watch(() => props.channelId, async () => {
|
watch(() => props.channelId, async () => {
|
||||||
channel.value = await misskeyApi('channels/show', {
|
channel.value = await misskeyApi('channels/show', {
|
||||||
channelId: props.channelId,
|
channelId: props.channelId,
|
||||||
|
|
Loading…
Reference in New Issue