From 1f8e2f9aad7c089f5ea6bd0930ab05ea26631126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 6 Feb 2025 19:31:44 -0500 Subject: [PATCH 1/2] fix: tidChanged --- public/src/client/topic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index be32f5cd2c..b345028812 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -38,7 +38,7 @@ define('forum/topic', [ }); Topic.init = async function () { - const tidChanged = !tid || String(tid) !== String(ajaxify.data.tid); + const tidChanged = tid === '0' || String(tid) !== String(ajaxify.data.tid); tid = String(ajaxify.data.tid); currentUrl = ajaxify.currentPage; hooks.fire('action:topic.loading'); From 3ab22c2c8c597d6e63b4583b16677bfbcce9d696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 6 Feb 2025 19:59:09 -0500 Subject: [PATCH 2/2] refactor: events are returned inside post objects to load all events of a topic use api/v3/topics/:tid/events --- public/openapi/read/topic/topic_id.yaml | 13 ------------- src/topics/index.js | 1 - 2 files changed, 14 deletions(-) diff --git a/public/openapi/read/topic/topic_id.yaml b/public/openapi/read/topic/topic_id.yaml index ded3e1f568..302d39dbcc 100644 --- a/public/openapi/read/topic/topic_id.yaml +++ b/public/openapi/read/topic/topic_id.yaml @@ -50,19 +50,6 @@ get: type: array items: $ref: ../../components/schemas/PostObject.yaml#/PostDataObject - events: - type: array - items: - type: object - properties: - type: - type: string - id: - type: number - timestamp: - type: number - timestampISO: - type: string category: $ref: ../../components/schemas/CategoryObject.yaml#/CategoryObject tagWhitelist: diff --git a/src/topics/index.js b/src/topics/index.js index 46483d441a..07600e6311 100644 --- a/src/topics/index.js +++ b/src/topics/index.js @@ -192,7 +192,6 @@ Topics.getTopicWithPosts = async function (topicData, set, uid, start, stop, rev topicData.thumbs = thumbs[0]; topicData.posts = posts; - topicData.events = events; topicData.posts.forEach((p) => { p.events = events.filter( event => event.timestamp >= p.eventStart && event.timestamp < p.eventEnd