Skip to content

Commit

Permalink
IMPROVE: bot button appears on all discovery routes & topics on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Oct 7, 2024
1 parent 6633cbf commit eb75768
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions assets/javascripts/discourse/components/chatbot-launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ export default class ContentLanguageDiscovery extends Component {
@service chat;
@service router;
@service composer;
@service site;

@tracked botUser = null;

get showChatbotButton() {
const { currentRouteName } = this.router;
const baseRoute = this.router.currentRouteName.split(".")[0];
return (
this.currentUser &&
this.siteSettings.chatbot_enabled &&
this.currentUser.chatbot_access &&
currentRouteName === `discovery.${defaultHomepage()}` &&
(baseRoute === "discovery" ||
(!this.site.mobileView &&
baseRoute === "topic")) &&
this.siteSettings.chatbot_quick_access_talk_button !== "off" &&
((this.siteSettings.chat_enabled &&
this.siteSettings.chatbot_permitted_in_chat) ||
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-chatbot
# about: a plugin that allows you to have a conversation with a configurable chatbot in Discourse Chat, Topics and Private Messages
# version: 1.1.0
# version: 1.1.1
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down

0 comments on commit eb75768

Please sign in to comment.