FIX: Hide summarization button from anons (#70)
This commit is contained in:
parent
261fe13599
commit
ba65d42940
|
@ -33,12 +33,16 @@ export default {
|
|||
name: "discourse-ai-topic-summary",
|
||||
|
||||
initialize(container) {
|
||||
const settings = container.lookup("service:site-settings");
|
||||
const summarizationEnabled =
|
||||
settings.discourse_ai_enabled && settings.ai_summarization_enabled;
|
||||
const user = container.lookup("service:current-user");
|
||||
|
||||
if (summarizationEnabled) {
|
||||
withPluginApi("1.6.0", initializeTopicSummary);
|
||||
if (user) {
|
||||
const settings = container.lookup("service:site-settings");
|
||||
const summarizationEnabled =
|
||||
settings.discourse_ai_enabled && settings.ai_summarization_enabled;
|
||||
|
||||
if (summarizationEnabled) {
|
||||
withPluginApi("1.6.0", initializeTopicSummary);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -8,7 +8,3 @@
|
|||
min-height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.topic-ai-summarization {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
.topic-ai-summarization {
|
||||
margin-left: 10px;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
.toggle-summary {
|
||||
button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.topic-ai-summarization {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
|
@ -13,7 +13,11 @@ gem "tiktoken_ruby", "0.0.5", platform: RUBY_PLATFORM
|
|||
enabled_site_setting :discourse_ai_enabled
|
||||
|
||||
register_asset "stylesheets/modules/ai-helper/common/ai-helper.scss"
|
||||
|
||||
register_asset "stylesheets/modules/summarization/common/summarization.scss"
|
||||
register_asset "stylesheets/modules/summarization/desktop/summarization.scss", :desktop
|
||||
register_asset "stylesheets/modules/summarization/mobile/summarization.scss", :mobile
|
||||
|
||||
register_asset "stylesheets/modules/ai-bot/common/bot-replies.scss"
|
||||
|
||||
module ::DiscourseAi
|
||||
|
|
Loading…
Reference in New Issue