mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
13 lines
436 B
TypeScript
13 lines
436 B
TypeScript
const DEVELOPMENT_MODE_COOKIE = "refine-live-preview-development-mode";
|
|
|
|
export const isDevelopmentModeByCookie = (): boolean => {
|
|
if (typeof document === "undefined") return false;
|
|
|
|
const cookie = document.cookie;
|
|
const parts = cookie.split(";");
|
|
const dev = parts.find((part) => part.includes(DEVELOPMENT_MODE_COOKIE));
|
|
if (!dev) return false;
|
|
const [, value] = dev.split("=");
|
|
return value === "true";
|
|
};
|