fix (error): Uncaught Error: undefined node for selector '[data-bind=backend-enabled]'

This commit is contained in:
MickaelK 2024-01-29 19:21:40 +11:00
parent fdd96adecb
commit cf83f7507c

View file

@ -7,6 +7,7 @@ import { isAdmin$ } from "./model_admin_session.js";
export default function AdminOnly(ctrlWrapped) {
return (render) => {
effect(isAdmin$().pipe(
rxjs.distinctUntilChanged(),
rxjs.map((isAdmin) => isAdmin ? ctrlWrapped : ctrlLogin),
rxjs.tap((ctrl) => ctrl(render)),
rxjs.catchError(ctrlError(render)),