mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 17:33:37 +08:00
DEV: Correctly clear global exported variables
This commit is contained in:
parent
258e9b22dd
commit
349f6e18f3
|
@ -9,7 +9,7 @@ export function addTopicTitleDecorator(decorator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetTopicTitleDecorators() {
|
export function resetTopicTitleDecorators() {
|
||||||
topicTitleDecorators = [];
|
topicTitleDecorators.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Component.extend(KeyEnterEscape, {
|
export default Component.extend(KeyEnterEscape, {
|
||||||
|
|
|
@ -108,6 +108,6 @@ export function addSectionLink(args, secondary) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetDefaultSectionLinks() {
|
export function resetDefaultSectionLinks() {
|
||||||
customSectionLinks = [];
|
customSectionLinks.length = 0;
|
||||||
secondaryCustomSectionLinks = [];
|
secondaryCustomSectionLinks.length = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,5 +10,5 @@ export function addSidebarSection(func) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetSidebarSection() {
|
export function resetSidebarSection() {
|
||||||
customSections.splice(0, customSections.length);
|
customSections.length = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,5 +60,5 @@ export function registerUserMenuTab(func) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetUserMenuTabs() {
|
export function resetUserMenuTabs() {
|
||||||
CUSTOM_TABS_CLASSES.clear();
|
CUSTOM_TABS_CLASSES.length = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ export function setTestPresence(value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function clearPresenceCallbacks() {
|
export function clearPresenceCallbacks() {
|
||||||
callbacks.splice(0, callbacks.length);
|
callbacks.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isTesting()) {
|
if (!isTesting()) {
|
||||||
|
|
|
@ -17,8 +17,8 @@ const LIKE_ACTION = 2;
|
||||||
const VIBRATE_DURATION = 5;
|
const VIBRATE_DURATION = 5;
|
||||||
|
|
||||||
const _builders = {};
|
const _builders = {};
|
||||||
let _extraButtons = {};
|
|
||||||
export let apiExtraButtons = {};
|
export let apiExtraButtons = {};
|
||||||
|
let _extraButtons = {};
|
||||||
let _buttonsToRemove = {};
|
let _buttonsToRemove = {};
|
||||||
|
|
||||||
export function addButton(name, builder) {
|
export function addButton(name, builder) {
|
||||||
|
@ -26,9 +26,12 @@ export function addButton(name, builder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetPostMenuExtraButtons() {
|
export function resetPostMenuExtraButtons() {
|
||||||
_buttonsToRemove = {};
|
for (const key of Object.keys(apiExtraButtons)) {
|
||||||
apiExtraButtons = {};
|
delete apiExtraButtons[key];
|
||||||
|
}
|
||||||
|
|
||||||
_extraButtons = {};
|
_extraButtons = {};
|
||||||
|
_buttonsToRemove = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeButton(name, callback) {
|
export function removeButton(name, callback) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user