mirror of
https://github.com/flarum/core.git
synced 2025-10-13 16:05:05 +02:00
* Rewrite ModalManagerState into Typescript - Fixes `attrs` parameter being marked as required - Add `isModalOpen` method * Rewrite ModalManager into Typescript * Fix incorrect type * Continue modal rewrite * Update attr typings * Fix correctly cast `this.constructor` calls * Cast to bool * Don't extend ModalAttrs by Record * Prevent missing abstract methods in child Modals from bricking frontend * Add missing `app` import * Address review comment Co-authored-by: David Sevilla Martin <6401250+datitisev@users.noreply.github.com> Co-authored-by: David Sevilla Martin <6401250+datitisev@users.noreply.github.com>
19 lines
674 B
TypeScript
19 lines
674 B
TypeScript
import app from '../app';
|
|
|
|
/**
|
|
* Calls `console.warn` with the provided arguments, but only if the forum is in debug mode.
|
|
*
|
|
* This function is intended to provide warnings to extension developers about issues with
|
|
* their extensions that may not be easily noticed when testing, such as accessibility
|
|
* issues.
|
|
*
|
|
* These warnings should be hidden on production forums to ensure webmasters are not
|
|
* inundated with do-gooders telling them they have an issue when it isn't something they
|
|
* can fix.
|
|
*/
|
|
export default function fireDebugWarning(...args: Parameters<typeof console.warn>): void {
|
|
if (!app.forum.attribute('debug')) return;
|
|
|
|
console.warn(...args);
|
|
}
|