@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.
- package/package.json +1 -1
- package/src/cms/resolve.ts +20 -0
package/package.json
CHANGED
package/src/cms/resolve.ts
CHANGED
|
@@ -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
|