From 23a9668ad73e78004d6d10574716f65ff4a5539e Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 25 Jul 2021 12:55:17 +0900 Subject: [PATCH 1/5] :art: --- src/client/ui/default.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index c8a16cff0..afaa96cec 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -143,7 +143,7 @@ export default defineComponent({ }, attachSticky(ref) { - const sticky = new StickySidebar(this.$refs[ref], this.$store.state.menuDisplay === 'top' ? 0 : 16, this.$store.state.menuDisplay === 'top' ? 60 : 0); // TODO: ヘッダーの高さを60pxと決め打ちしているのを直す + const sticky = new StickySidebar(this.$refs[ref], this.$store.state.menuDisplay === 'top' ? 1 : 16, this.$store.state.menuDisplay === 'top' ? 60 : 0); // TODO: ヘッダーの高さを60pxと決め打ちしているのを直す window.addEventListener('scroll', () => { sticky.calc(window.scrollY); }, { passive: true }); From 9c59d57d7a679d056e70298d7493dbffd941eb49 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 25 Jul 2021 13:07:08 +0900 Subject: [PATCH 2/5] fix bug --- src/client/store.ts | 2 +- src/client/ui/default.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/store.ts b/src/client/store.ts index 2ae9cd790..6ca431e05 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -90,7 +90,7 @@ export const defaultStore = markRaw(new Storage('base', { default: [] as { name: string; id: string; - place: string; + place: string | null; data: Record; }[] }, diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index afaa96cec..5e79cd383 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -115,13 +115,13 @@ export default defineComponent({ if (this.$store.state.widgets.length === 0) { this.$store.set('widgets', [{ name: 'calendar', - id: 'a', place: 'right', data: {} + id: 'a', place: null, data: {} }, { name: 'notifications', - id: 'b', place: 'right', data: {} + id: 'b', place: null, data: {} }, { name: 'trends', - id: 'c', place: 'right', data: {} + id: 'c', place: null, data: {} }]); } }, From 34242239311ad79a1d91466a0e07d1f9203cd869 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 25 Jul 2021 13:28:33 +0900 Subject: [PATCH 3/5] fix email notification bug --- src/services/create-notification.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/create-notification.ts b/src/services/create-notification.ts index 261b36814..7d2726971 100644 --- a/src/services/create-notification.ts +++ b/src/services/create-notification.ts @@ -1,6 +1,6 @@ import { publishMainStream } from './stream'; import pushSw from './push-notification'; -import { Notifications, Mutings, UserProfiles } from '../models'; +import { Notifications, Mutings, UserProfiles, Users } from '../models'; import { genId } from '@/misc/gen-id'; import { User } from '../models/entities/user'; import { Notification } from '../models/entities/notification'; @@ -53,8 +53,8 @@ export async function createNotification( publishMainStream(notifieeId, 'unreadNotification', packed); pushSw(notifieeId, 'notification', packed); - if (type === 'follow') sendEmailNotification.follow(notifieeId, data); - if (type === 'receiveFollowRequest') sendEmailNotification.receiveFollowRequest(notifieeId, data); + if (type === 'follow') sendEmailNotification.follow(notifieeId, await Users.findOneOrFail(data.notifierId!)); + if (type === 'receiveFollowRequest') sendEmailNotification.receiveFollowRequest(notifieeId, await Users.findOneOrFail(data.notifierId!)); }, 2000); return notification; From 44cc81f18fe077d966756e6206eaaeafe9563d06 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 26 Jul 2021 11:12:06 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=83=9F=E3=83=B3=E3=82=B0=E3=81=8C=E4=B8=8D=E5=AE=89=E5=AE=9A?= =?UTF-8?q?=E3=81=AA=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 3 ++ src/client/components/drive.vue | 4 +-- src/client/components/follow-button.vue | 4 +-- src/client/components/notification.vue | 4 +-- src/client/components/notifications.vue | 4 +-- src/client/components/timeline.vue | 28 +++++++++---------- src/client/init.ts | 4 +-- src/client/pages/instance/metrics.vue | 4 +-- src/client/pages/instance/queue.vue | 4 +-- src/client/pages/messaging/index.vue | 4 +-- src/client/pages/messaging/messaging-room.vue | 6 ++-- src/client/pages/reversi/game.vue | 6 ++-- src/client/pages/reversi/index.vue | 4 +-- src/client/ui/chat/timeline.vue | 28 +++++++++---------- src/client/widgets/job-queue.vue | 4 +-- src/client/widgets/photos.vue | 4 +-- src/client/widgets/server-metric/index.vue | 4 +-- 17 files changed, 61 insertions(+), 58 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6dc2e5e22..436d4224d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -242,6 +242,9 @@ npx ts-node ./node_modules/typeorm/cli.js migration:generate -n 変更の名前 作成されたスクリプトは不必要な変更を含むため除去してください。 +### コネクションには`markRaw`せよ +**Vueのコンポーネントのdataオプションとして**misskey.jsのコネクションを設定するとき、必ず`markRaw`でラップしてください。インスタンスが不必要にリアクティブ化されることで、misskey.js内の処理で不具合が発生するとともに、パフォーマンス上の問題にも繋がる。なお、Composition APIを使う場合はこの限りではない(リアクティブ化はマニュアルなため)。 + ## その他 ### HTMLのクラス名で follow という単語は使わない 広告ブロッカーで誤ってブロックされる diff --git a/src/client/components/drive.vue b/src/client/components/drive.vue index ca637e3f3..16aa9dc1a 100644 --- a/src/client/components/drive.vue +++ b/src/client/components/drive.vue @@ -46,7 +46,7 @@