mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-16 13:25:02 +01:00
25 lines
674 B
JavaScript
25 lines
674 B
JavaScript
import { createElement, navigate } from "../lib/skeleton/index.js";
|
|
import rxjs, { effect } from "../lib/rxjs/index.js";
|
|
import ajax from "../lib/ajax/index.js";
|
|
|
|
import ctrlError from "./ctrl_error.js";
|
|
import "../components/icon.js";
|
|
|
|
export default function(render) {
|
|
const $page = createElement(`
|
|
<div class="center">
|
|
<component-icon name="loading"></component-icon>
|
|
</div>
|
|
`);
|
|
render($page);
|
|
|
|
effect(ajax({
|
|
url: "/api/session",
|
|
method: "DELETE",
|
|
withCredentials: true,
|
|
}).pipe(
|
|
rxjs.delay(5000),
|
|
rxjs.tap(() => navigate("/")),
|
|
rxjs.catchError(ctrlError(render)),
|
|
));
|
|
}
|