enhance: タイムラインにフォロイーの行った他人へのリプライを含めるかどうかの設定をアカウントに保存するのをやめるように

Resolve #10646
This commit is contained in:
syuilo
2023-05-16 12:16:37 +09:00
parent 23f106a0c1
commit d10d5a8d53
20 changed files with 78 additions and 54 deletions

View File

@@ -70,7 +70,12 @@ if (props.src === 'antenna') {
connection.on('note', prepend);
} else if (props.src === 'home') {
endpoint = 'notes/timeline';
connection = stream.useChannel('homeTimeline');
query = {
withReplies: defaultStore.state.showTimelineReplies,
};
connection = stream.useChannel('homeTimeline', {
withReplies: defaultStore.state.showTimelineReplies,
});
connection.on('note', prepend);
connection2 = stream.useChannel('main');
@@ -78,15 +83,30 @@ if (props.src === 'antenna') {
connection2.on('unfollow', onChangeFollowing);
} else if (props.src === 'local') {
endpoint = 'notes/local-timeline';
connection = stream.useChannel('localTimeline');
query = {
withReplies: defaultStore.state.showTimelineReplies,
};
connection = stream.useChannel('localTimeline', {
withReplies: defaultStore.state.showTimelineReplies,
});
connection.on('note', prepend);
} else if (props.src === 'social') {
endpoint = 'notes/hybrid-timeline';
connection = stream.useChannel('hybridTimeline');
query = {
withReplies: defaultStore.state.showTimelineReplies,
};
connection = stream.useChannel('hybridTimeline', {
withReplies: defaultStore.state.showTimelineReplies,
});
connection.on('note', prepend);
} else if (props.src === 'global') {
endpoint = 'notes/global-timeline';
connection = stream.useChannel('globalTimeline');
query = {
withReplies: defaultStore.state.showTimelineReplies,
};
connection = stream.useChannel('globalTimeline', {
withReplies: defaultStore.state.showTimelineReplies,
});
connection.on('note', prepend);
} else if (props.src === 'mentions') {
endpoint = 'notes/mentions';

View File

@@ -148,6 +148,7 @@
<template #label>{{ i18n.ts.other }}</template>
<div class="_gaps">
<MkSwitch v-model="showTimelineReplies">{{ i18n.ts.flagShowTimelineReplies }}<template #caption>{{ i18n.ts.flagShowTimelineRepliesDescription }} {{ i18n.ts.reflectMayTakeTime }}</template></MkSwitch>
<FormLink to="/settings/deck">{{ i18n.ts.deck }}</FormLink>
<FormLink to="/settings/custom-css"><template #icon><i class="ti ti-code"></i></template>{{ i18n.ts.customCss }}</FormLink>
</div>
@@ -216,6 +217,7 @@ const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
const mediaListWithOneImageAppearance = computed(defaultStore.makeGetterSetter('mediaListWithOneImageAppearance'));
const notificationPosition = computed(defaultStore.makeGetterSetter('notificationPosition'));
const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis'));
const showTimelineReplies = computed(defaultStore.makeGetterSetter('showTimelineReplies'));
watch(lang, () => {
miLocalStorage.setItem('lang', lang.value as string);

View File

@@ -91,8 +91,6 @@
<option value="likeOnly">{{ i18n.ts.likeOnly }}</option>
<option value="likeOnlyForRemote">{{ i18n.ts.likeOnlyForRemote }}</option>
</MkSelect>
<MkSwitch v-model="profile.showTimelineReplies">{{ i18n.ts.flagShowTimelineReplies }}<template #caption>{{ i18n.ts.flagShowTimelineRepliesDescription }} {{ i18n.ts.reflectMayTakeTime }}</template></MkSwitch>
</div>
</template>

View File

@@ -102,6 +102,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: [] as string[],
},
showTimelineReplies: {
where: 'account',
default: false,
},
menu: {
where: 'deviceAccount',