diff --git a/framework/core/js/src/common/states/PageState.ts b/framework/core/js/src/common/states/PageState.ts index 366480174..5e872834c 100644 --- a/framework/core/js/src/common/states/PageState.ts +++ b/framework/core/js/src/common/states/PageState.ts @@ -21,7 +21,15 @@ export default class PageState { * @param {Record} data * @return {boolean} */ - matches(type: Function, data: any = {}) { + matches(type: Function | string, data: any = {}) { + if (typeof type === 'string') { + const [namespace, id] = flarum.reg.namespaceAndIdFromPath(type); + + type = flarum.reg.checkModule(namespace, id); + + if (!type) return false; + } + // Fail early when the page is of a different type if (!subclassOf(this.type, type)) return false;