From ef31c7df635b8dbb0ee7cf15aa3bcb944c6d3f4a Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Fri, 2 Dec 2022 17:46:49 +0100 Subject: [PATCH] DEV: Remove unused new-user-narrative code (#19299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This method override was misnamed from the beginning and nobody noticed that this special bookmark handling was missing so… --- .../initializers/new-user-narrative.js | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js b/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js index 4b12e22bad2..234e7ec2066 100644 --- a/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js +++ b/plugins/discourse-narrative-bot/assets/javascripts/initializers/new-user-narrative.js @@ -1,5 +1,4 @@ import { debounce } from "discourse-common/utils/decorators"; -import { ajax } from "discourse/lib/ajax"; import { headerOffset } from "discourse/lib/offset-calculator"; import isElementInViewport from "discourse/lib/is-element-in-viewport"; import { withPluginApi } from "discourse/lib/plugin-api"; @@ -22,27 +21,6 @@ function initialize(api) { api.modifyClass("controller:topic", { pluginId: PLUGIN_ID, - _modifyBookmark(bookmark, post) { - // if we are talking to discobot then any bookmarks should just - // be created without reminder options, to streamline the new user - // narrative. - const discobotUserId = -2; - if (post && post.user_id === discobotUserId && !post.bookmarked) { - return ajax("/bookmarks", { - type: "POST", - data: { post_id: post.id }, - }).then((response) => { - post.setProperties({ - "topic.bookmarked": true, - bookmarked: true, - bookmark_id: response.id, - }); - post.appEvents.trigger("post-stream:refresh", { id: this.id }); - }); - } - return this._super(bookmark, post); - }, - subscribe() { this._super(...arguments);