From d3bb44d6360e6f870d647c0df0483cc39c7c41d3 Mon Sep 17 00:00:00 2001
From: shiran <2488252513@qq.com>
Date: Fri, 20 Feb 2026 09:41:57 +0800
Subject: [PATCH] =?UTF-8?q?refactor(horizon):=20=E7=A7=BB=E9=99=A4?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E9=80=9A=E7=9F=A5=E5=B9=B6=E7=AE=80?=
=?UTF-8?q?=E5=8C=96=E4=B8=BB=E9=A2=98=E5=88=9D=E5=A7=8B=E5=8C=96=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 删除了管理员使用Horizon主题时的全局通知功能
- 移除了主题ID获取和URL构建相关代码
- 简化了API初始化器中的条件判断逻辑
- 保留了实验性屏幕组件和用户颜色选择器的渲染功能
---
.../discourse/api-initializers/horizon.gjs | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/javascripts/discourse/api-initializers/horizon.gjs b/javascripts/discourse/api-initializers/horizon.gjs
index 5ce8b29..36342d8 100644
--- a/javascripts/discourse/api-initializers/horizon.gjs
+++ b/javascripts/discourse/api-initializers/horizon.gjs
@@ -1,26 +1,8 @@
-import { addGlobalNotice } from "discourse/components/global-notice";
import { apiInitializer } from "discourse/lib/api";
-import getURL from "discourse/lib/get-url";
-import { currentThemeId } from "discourse/lib/theme-selector";
import ExperimentalScreen from "../components/experimental-screen";
import UserColorPaletteSelector from "../components/user-color-palette-selector";
export default apiInitializer("1.8.0", (api) => {
- if (api.getCurrentUser()?.admin) {
- const themeId = currentThemeId();
- const themeURL = getURL(`/admin/customize/themes/${themeId}`);
- const horizonThemeUrl = getURL(`/admin/customize/themes/-2`);
- addGlobalNotice(
- `Admin notice: you are using the Horizon (beta) theme. This theme is now installed automatically in Discourse core. You should uninstall this theme, and reconfigure the preinstalled Horizon theme.`,
- "loading-slider-theme",
- {
- dismissable: true,
- level: "warn",
- dismissDuration: moment.duration("1", "hour"),
- }
- );
- }
-
api.renderInOutlet("above-main-container", ExperimentalScreen);
api.renderInOutlet("sidebar-footer-actions", UserColorPaletteSelector);