From a93f97170319b124b2330e1340e6660e3e3092b1 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 18 Sep 2023 10:41:51 +0900 Subject: [PATCH] fix: "show replies in timeline" refactoring was not backward compatible --- .../backend/src/server/api/stream/channels/global-timeline.ts | 2 +- .../backend/src/server/api/stream/channels/home-timeline.ts | 2 +- .../backend/src/server/api/stream/channels/hybrid-timeline.ts | 2 +- .../backend/src/server/api/stream/channels/local-timeline.ts | 2 +- .../src/server/api/stream/channels/recommended-timeline.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index 2257be2b8..f2aca7e3c 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -23,7 +23,7 @@ export default class extends Channel { return; } - this.withReplies = params.withReplies as boolean; + this.withReplies = params != null ? !!params.withReplies : true; // Subscribe events this.subscriber.on("notesStream", this.onNote); diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 47875aeda..52e2dc2a9 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -16,7 +16,7 @@ export default class extends Channel { } public async init(params: any) { - this.withReplies = params.withReplies as boolean; + this.withReplies = params != null ? !!params.withReplies : true; // Subscribe events this.subscriber.on("notesStream", this.onNote); diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index 1f1a9b831..6e2da514f 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -25,7 +25,7 @@ export default class extends Channel { ) return; - this.withReplies = params.withReplies as boolean; + this.withReplies = params != null ? !!params.withReplies : true; // Subscribe events this.subscriber.on("notesStream", this.onNote); diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts index bd488bdd7..2cc286b17 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -22,7 +22,7 @@ export default class extends Channel { return; } - this.withReplies = params.withReplies as boolean; + this.withReplies = params != null ? !!params.withReplies : true; // Subscribe events this.subscriber.on("notesStream", this.onNote); diff --git a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts index 0b78d8b66..186b12032 100644 --- a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts @@ -25,7 +25,7 @@ export default class extends Channel { ) return; - this.withReplies = params.withReplies as boolean; + this.withReplies = params != null ? !!params.withReplies : true; // Subscribe events this.subscriber.on("notesStream", this.onNote);