Improve page load times and rendering

This commit is contained in:
adilallo
2026-05-26 06:59:52 -06:00
parent 6b45a2e5d0
commit 3be188a3cc
29 changed files with 467 additions and 176 deletions
@@ -8,7 +8,7 @@ import { memo, useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { useTranslation } from "../../../contexts/MessagesContext";
import { logger } from "../../../../lib/logger";
import { prepareFreshCreateFlowEntry } from "../../../(app)/create/utils/prepareFreshCreateFlowEntry";
import { prepareFreshCreateFlowEntrySync } from "../../../(app)/create/utils/prepareFreshCreateFlowEntry";
import {
fetchTemplates,
isTemplatesFetchAborted,
@@ -99,10 +99,8 @@ const RuleStackContainer = memo<RuleStackProps>(
logger.debug(`${slug} template clicked`);
// Marketing home “Popular templates”: same fresh start as Top “Create rule”
// (local + server draft when sync) so stale state cannot break template apply.
void (async () => {
await prepareFreshCreateFlowEntry();
router.push(`/create/review-template/${encodeURIComponent(slug)}`);
})();
prepareFreshCreateFlowEntrySync();
router.push(`/create/review-template/${encodeURIComponent(slug)}`);
};
return (