wip fix
This commit is contained in:
parent
447b71576d
commit
9b1976ea70
|
|
@ -5,6 +5,10 @@ import { TopBtn } from "../top-btn";
|
|||
export const EdPagePicker = () => {
|
||||
const p = useGlobal(EDGlobal, "EDITOR");
|
||||
|
||||
if (p.page.cur.name !== p.page.list[p.page.cur.id].page.name) {
|
||||
p.page.cur.name = p.page.list[p.page.cur.id].page.name;
|
||||
}
|
||||
|
||||
return (
|
||||
<TopBtn
|
||||
onClick={(e) => {
|
||||
|
|
|
|||
|
|
@ -12,10 +12,11 @@ import {
|
|||
savePageMetaCache,
|
||||
} from "../ed/logic/ed-route";
|
||||
import { loadSite } from "../ed/logic/ed-site";
|
||||
import { treeCacheBuild } from "../ed/logic/tree/build";
|
||||
import { treeCacheBuild, treeRebuild } from "../ed/logic/tree/build";
|
||||
import { nav } from "./render/script/extract-nav";
|
||||
import { Vi } from "./vi";
|
||||
import parseUA from "ua-parser-js";
|
||||
import { DeadEnd } from "../../utils/ui/deadend";
|
||||
|
||||
const decoder = new TextDecoder();
|
||||
export const ViPreview = (arg: { pathname: string }) => {
|
||||
|
|
@ -66,6 +67,18 @@ export const ViPreview = (arg: { pathname: string }) => {
|
|||
viRoute(p);
|
||||
|
||||
if (p.status !== "ready" && p.status !== "reload") {
|
||||
if (p.status === "page-not-found") {
|
||||
return (
|
||||
<DeadEnd
|
||||
back={() => {
|
||||
history.back();
|
||||
}}
|
||||
>
|
||||
Page Not Found
|
||||
</DeadEnd>
|
||||
);
|
||||
}
|
||||
|
||||
return <Loading note={p.status + "-page"} />;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
import { FC } from "react";
|
||||
import { treeRebuild } from "../../nova/ed/logic/tree/build";
|
||||
import { useGlobal } from "web-utils";
|
||||
|
||||
export const DeadEnd: FC<{ children: any }> = ({ children }) => {
|
||||
export const DeadEnd: FC<{ children: any; back: () => void }> = ({
|
||||
children,
|
||||
back,
|
||||
}) => {
|
||||
return (
|
||||
<div className="flex items-center justify-center w-full h-full fixed inset-0">
|
||||
{children}
|
||||
<div className="flex items-center justify-center w-full h-full fixed inset-0 flex-col">
|
||||
<div>{children}</div>
|
||||
<div className="border mt-2 rounded-md p-2 cursor-pointer" onClick={back}>
|
||||
{" "}
|
||||
Go Back
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,9 +21,14 @@ export const Input: FC<
|
|||
delete prop.onChange;
|
||||
}
|
||||
|
||||
let value = form[name];
|
||||
if (value instanceof URL) {
|
||||
value = value.toString();
|
||||
}
|
||||
|
||||
return (
|
||||
<input
|
||||
value={form[name] || ""}
|
||||
value={value || ""}
|
||||
spellCheck={false}
|
||||
onInput={(e) => {
|
||||
form[name] = e.currentTarget.value;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export const defineWindow = async (awaitServerUrl = true) => {
|
|||
if (!_href) return null;
|
||||
}
|
||||
|
||||
history.pushState({}, "", _href);
|
||||
history.pushState({ prevUrl: window.location.href }, "", _href);
|
||||
w.pathname = href;
|
||||
|
||||
if (w.prasiContext && w.prasiContext.render) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue