Skip to content

Commit

Permalink
「既にフォローしている場合、通知欄にフォローボタンを表示しない」をオプショナルに
Browse files Browse the repository at this point in the history
  • Loading branch information
EbiseLutica committed Apr 14, 2023
1 parent 2784121 commit 9345149
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 1 addition & 4 deletions packages/frontend/src/components/MkFollowButton.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<span v-if="disableIfFollowing && isFollowing" style="opacity: 0.5">
{{ $ts.alreadyFollowed }}
</span>
<button
v-else
v-if="!disableIfFollowing || !isFollowing"
class="kpoogebi _button"
:class="{ wait, active: isFollowing || hasPendingFollowRequestFromYou, full, large }"
:disabled="wait"
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/MkNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</MkA>
<template v-else-if="notification.type === 'follow'">
<span :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.youGotNewFollower }}</span>
<div v-if="full"><MkFollowButton :user="notification.user" :full="true" disable-if-following/></div>
<div v-if="full"><MkFollowButton :user="notification.user" :full="true" :disable-if-following="defaultStore.reactiveState.showFollowingMessageInsteadOfButtonEnabled.value"/></div>
</template>
<span v-else-if="notification.type === 'followRequestAccepted'" :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.followRequestAccepted }}</span>
<template v-else-if="notification.type === 'receiveFollowRequest'">
Expand Down Expand Up @@ -96,6 +96,7 @@ import { i18n } from '@/i18n';
import * as os from '@/os';
import { useTooltip } from '@/scripts/use-tooltip';
import { $i } from '@/account';
import {defaultStore} from "@/store";
const props = withDefaults(defineProps<{
notification: misskey.entities.Notification;
Expand Down
7 changes: 6 additions & 1 deletion packages/frontend/src/pages/settings/ebisskey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<MkSwitch v-model="reactableRemoteReactionEnabled">
リモートのカスタム絵文字リアクションでも、このサーバーに同じ名前の絵文字があればリアクションできるようにする
</MkSwitch>
<MkSwitch v-model="showFollowingMessageInsteadOfButtonEnabled">
既にフォローしている場合、通知欄にフォローボタンを表示しない
</MkSwitch>
</div>
</FormSection>
<FormSection>
Expand Down Expand Up @@ -75,6 +78,8 @@ import { definePageMetadata } from '@/scripts/page-metadata';
import MkNote from "@/components/MkNote.vue";
import {Note, User} from "misskey-js/built/entities";
import {$i} from "@/account";
import MkButton from "@/components/MkButton.vue";
import {confetti} from "@/scripts/confetti";
async function reloadAsk() {
const { canceled } = await os.confirm({
Expand All @@ -94,6 +99,7 @@ const reactableRemoteReactionEnabled = computed(defaultStore.makeGetterSetter('r
const rememberPostFormToggleStateEnabled = computed(defaultStore.makeGetterSetter('rememberPostFormToggleStateEnabled'));
const usePostFormWindow = computed(defaultStore.makeGetterSetter('usePostFormWindow'));
const ebiNoteViewEnabled = computed(defaultStore.makeGetterSetter('ebiNoteViewEnabledLab'));
const showFollowingMessageInsteadOfButtonEnabled = computed(defaultStore.makeGetterSetter('showFollowingMessageInsteadOfButtonEnabled'));
const noteMock: Note = {
id: 'abc',
Expand All @@ -112,7 +118,6 @@ const noteMock: Note = {
repliesCount: 10,
emojis: [],
localOnly: true,
};
watch([
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: true,
},
showFollowingMessageInsteadOfButtonEnabled: {
where: 'account',
default: true,
},

// -- Labs
usePostFormWindow: {
where: 'device',
Expand Down

0 comments on commit 9345149

Please sign in to comment.