DEV: Clear extra header buttons (#17829)

This commit is contained in:
Jarek Radosz 2022-08-08 19:57:56 +02:00 committed by GitHub
parent e0f469eab8
commit 9645cbea26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -14,12 +14,16 @@ import { logSearchLinkClick } from "discourse/lib/search";
import RenderGlimmer from "discourse/widgets/render-glimmer"; import RenderGlimmer from "discourse/widgets/render-glimmer";
import { hbs } from "ember-cli-htmlbars"; import { hbs } from "ember-cli-htmlbars";
const _extraHeaderIcons = []; let _extraHeaderIcons = [];
export function addToHeaderIcons(icon) { export function addToHeaderIcons(icon) {
_extraHeaderIcons.push(icon); _extraHeaderIcons.push(icon);
} }
export function clearExtraHeaderIcons() {
_extraHeaderIcons = [];
}
const dropdown = { const dropdown = {
buildClasses(attrs) { buildClasses(attrs) {
let classes = attrs.classNames || []; let classes = attrs.classNames || [];

View File

@ -71,6 +71,7 @@ import {
} from "discourse/lib/to-markdown"; } from "discourse/lib/to-markdown";
import { clearTagsHtmlCallbacks } from "discourse/lib/render-tags"; import { clearTagsHtmlCallbacks } from "discourse/lib/render-tags";
import { clearToolbarCallbacks } from "discourse/components/d-editor"; import { clearToolbarCallbacks } from "discourse/components/d-editor";
import { clearExtraHeaderIcons } from "discourse/widgets/header";
import { resetSidebarSection } from "discourse/lib/sidebar/custom-sections"; import { resetSidebarSection } from "discourse/lib/sidebar/custom-sections";
import { resetNotificationTypeRenderers } from "discourse/lib/notification-item"; import { resetNotificationTypeRenderers } from "discourse/lib/notification-item";
@ -202,6 +203,7 @@ export function testCleanup(container, app) {
clearToolbarCallbacks(); clearToolbarCallbacks();
resetSidebarSection(); resetSidebarSection();
resetNotificationTypeRenderers(); resetNotificationTypeRenderers();
clearExtraHeaderIcons();
} }
export function discourseModule(name, options) { export function discourseModule(name, options) {