mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-16 05:18:38 +01:00
18 lines
657 B
JavaScript
18 lines
657 B
JavaScript
import { navigate } from "../lib/skeleton/index.js";
|
|
import { toHref } from "../lib/skeleton/router.js";
|
|
import rxjs, { effect } from "../lib/rx.js";
|
|
|
|
import { deleteSession } from "../model/session.js";
|
|
import { init as setup_config, get as getConfig } from "../model/config.js";
|
|
import ctrlError from "./ctrl_error.js";
|
|
import $loader from "../components/loader.js";
|
|
|
|
export default function(render) {
|
|
render($loader);
|
|
|
|
effect(deleteSession().pipe(
|
|
rxjs.mergeMap(setup_config),
|
|
rxjs.tap(() => getConfig("logout") ? location.href = getConfig("logout") : navigate(toHref("/"))),
|
|
rxjs.catchError(ctrlError(render)),
|
|
));
|
|
}
|