@orion-studios/payload-studio 0.6.0-beta.32 → 0.6.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3059,14 +3059,21 @@ function AdminShellClient({
3059
3059
  onLogout,
3060
3060
  storageKey = "orion-admin-shell-collapsed"
3061
3061
  }) {
3062
- const [collapsed, setCollapsed] = (0, import_react14.useState)(false);
3062
+ const [collapsed, setCollapsed] = (0, import_react14.useState)(() => {
3063
+ if (typeof window === "undefined") {
3064
+ return true;
3065
+ }
3066
+ try {
3067
+ return window.localStorage.getItem(storageKey) === "1";
3068
+ } catch {
3069
+ return false;
3070
+ }
3071
+ });
3063
3072
  const [loggingOut, setLoggingOut] = (0, import_react14.useState)(false);
3064
3073
  (0, import_react14.useEffect)(() => {
3065
3074
  try {
3066
3075
  const stored = window.localStorage.getItem(storageKey);
3067
- if (stored === "1") {
3068
- setCollapsed(true);
3069
- }
3076
+ setCollapsed(stored === "1");
3070
3077
  } catch {
3071
3078
  }
3072
3079
  }, [storageKey]);
@@ -9,7 +9,7 @@ import {
9
9
  SiteFooterPreview,
10
10
  adminNavIcons,
11
11
  buildAdminPageLinkOptions
12
- } from "../chunk-KPIX7OSV.mjs";
12
+ } from "../chunk-2XH7X34N.mjs";
13
13
  import "../chunk-ROTPP5CU.mjs";
14
14
  import {
15
15
  BlockPicker,
@@ -122,14 +122,21 @@ function AdminShellClient({
122
122
  onLogout,
123
123
  storageKey = "orion-admin-shell-collapsed"
124
124
  }) {
125
- const [collapsed, setCollapsed] = (0, import_react.useState)(false);
125
+ const [collapsed, setCollapsed] = (0, import_react.useState)(() => {
126
+ if (typeof window === "undefined") {
127
+ return true;
128
+ }
129
+ try {
130
+ return window.localStorage.getItem(storageKey) === "1";
131
+ } catch {
132
+ return false;
133
+ }
134
+ });
126
135
  const [loggingOut, setLoggingOut] = (0, import_react.useState)(false);
127
136
  (0, import_react.useEffect)(() => {
128
137
  try {
129
138
  const stored = window.localStorage.getItem(storageKey);
130
- if (stored === "1") {
131
- setCollapsed(true);
132
- }
139
+ setCollapsed(stored === "1");
133
140
  } catch {
134
141
  }
135
142
  }, [storageKey]);
@@ -8,7 +8,7 @@ import {
8
8
  MediaUploadForm,
9
9
  SiteFooterPreview,
10
10
  SiteHeaderPreview
11
- } from "../chunk-KPIX7OSV.mjs";
11
+ } from "../chunk-2XH7X34N.mjs";
12
12
  import "../chunk-ROTPP5CU.mjs";
13
13
 
14
14
  // src/admin-app/components/PageEditorFrame.tsx
@@ -103,14 +103,21 @@ function AdminShellClient({
103
103
  onLogout,
104
104
  storageKey = "orion-admin-shell-collapsed"
105
105
  }) {
106
- const [collapsed, setCollapsed] = useState(false);
106
+ const [collapsed, setCollapsed] = useState(() => {
107
+ if (typeof window === "undefined") {
108
+ return true;
109
+ }
110
+ try {
111
+ return window.localStorage.getItem(storageKey) === "1";
112
+ } catch {
113
+ return false;
114
+ }
115
+ });
107
116
  const [loggingOut, setLoggingOut] = useState(false);
108
117
  useEffect(() => {
109
118
  try {
110
119
  const stored = window.localStorage.getItem(storageKey);
111
- if (stored === "1") {
112
- setCollapsed(true);
113
- }
120
+ setCollapsed(stored === "1");
114
121
  } catch {
115
122
  }
116
123
  }, [storageKey]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.32",
3
+ "version": "0.6.0-beta.34",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",