@r2digisolutions/components 0.21.20 → 0.21.21
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.
|
@@ -78,6 +78,15 @@
|
|
|
78
78
|
children
|
|
79
79
|
}: AppShellProps = $props();
|
|
80
80
|
|
|
81
|
+
// Context must be set during component init — never inside $derived (async SSR
|
|
82
|
+
// re-entry / first read would call setContext outside init → 500).
|
|
83
|
+
const sharedChrome = getSharedAppChrome();
|
|
84
|
+
try {
|
|
85
|
+
getAppChrome();
|
|
86
|
+
} catch {
|
|
87
|
+
setAppChrome(sharedChrome);
|
|
88
|
+
}
|
|
89
|
+
|
|
81
90
|
// Resolve via singleton inside deriveds so HMR / duplicate graphs stay aligned.
|
|
82
91
|
const propContextual = $derived.by((): AppShellContextual | null => {
|
|
83
92
|
if (contextualGroups.length === 0) return null;
|
|
@@ -91,14 +100,8 @@
|
|
|
91
100
|
});
|
|
92
101
|
|
|
93
102
|
const resolvedContextual = $derived.by(() => {
|
|
94
|
-
const chrome = getSharedAppChrome();
|
|
95
|
-
try {
|
|
96
|
-
getAppChrome();
|
|
97
|
-
} catch {
|
|
98
|
-
setAppChrome(chrome);
|
|
99
|
-
}
|
|
100
103
|
void getAppChromeEpoch();
|
|
101
|
-
return
|
|
104
|
+
return getSharedAppChrome().source?.() ?? propContextual;
|
|
102
105
|
});
|
|
103
106
|
const contextualKey = $derived(
|
|
104
107
|
resolvedContextual
|