@decocms/start 4.2.0 → 4.2.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cms/resolve.ts +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/start",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "type": "module",
5
5
  "description": "Deco framework for TanStack Start - CMS bridge, admin protocol, hooks, schema generation",
6
6
  "main": "./src/index.ts",
@@ -1391,6 +1391,26 @@ async function resolveDecoPageImpl(
1391
1391
  try {
1392
1392
  const deferred = resolveSectionShallow(section, ctx);
1393
1393
  if (deferred) {
1394
+ // Skip sections whose scheduling window has already closed (or
1395
+ // hasn't opened yet). Without this check a LoadingFallback
1396
+ // skeleton is rendered and immediately replaced by nothing once
1397
+ // the component's own scheduling guard returns null — producing
1398
+ // the "skeleton flashes then disappears" effect.
1399
+ const sched = deferred.rawProps?.scheduling as
1400
+ | { start?: string; end?: string }
1401
+ | undefined;
1402
+ if (sched) {
1403
+ const now = Date.now();
1404
+ if (sched.end && now > new Date(sched.end).getTime()) {
1405
+ flatIndex++;
1406
+ continue;
1407
+ }
1408
+ if (sched.start && now < new Date(sched.start).getTime()) {
1409
+ flatIndex++;
1410
+ continue;
1411
+ }
1412
+ }
1413
+
1394
1414
  deferred.index = currentFlatIndex;
1395
1415
 
1396
1416
  // Cache rawProps server-side and strip from the deferred object