wip fix
This commit is contained in:
parent
8ce421c8eb
commit
48b962ba47
|
|
@ -4,6 +4,7 @@ import { isMetaActive } from "../../logic/active/is-meta.active";
|
||||||
import { EDGlobal, IMeta, PG, active } from "../../logic/ed-global";
|
import { EDGlobal, IMeta, PG, active } from "../../logic/ed-global";
|
||||||
import { mainPerItemVisit } from "./main-per-item";
|
import { mainPerItemVisit } from "./main-per-item";
|
||||||
import { w } from "../../../../utils/types/general";
|
import { w } from "../../../../utils/types/general";
|
||||||
|
import parseUA from "ua-parser-js";
|
||||||
|
|
||||||
export const EdMain = () => {
|
export const EdMain = () => {
|
||||||
const p = useGlobal(EDGlobal, "EDITOR");
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
|
|
@ -31,6 +32,25 @@ export const EdMain = () => {
|
||||||
meta = p.page.meta[active.item_id];
|
meta = p.page.meta[active.item_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p.site.id) {
|
||||||
|
if (!p.mode && !!p.site.responsive) {
|
||||||
|
if (
|
||||||
|
p.site.responsive !== "mobile-only" &&
|
||||||
|
p.site.responsive !== "desktop-only"
|
||||||
|
) {
|
||||||
|
const parsed = parseUA();
|
||||||
|
p.mode = parsed.device.type === "mobile" ? "mobile" : "desktop";
|
||||||
|
if (localStorage.getItem("prasi-editor-mode")) {
|
||||||
|
p.mode = localStorage.getItem("prasi-editor-mode") as any;
|
||||||
|
}
|
||||||
|
} else if (p.site.responsive === "mobile-only") {
|
||||||
|
p.mode = "mobile";
|
||||||
|
} else if (p.site.responsive === "desktop-only") {
|
||||||
|
p.mode = "desktop";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (active.should_render_main) {
|
if (active.should_render_main) {
|
||||||
local.cache = (
|
local.cache = (
|
||||||
<Vi
|
<Vi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue