Turn a saved draft into the finished Rule, and greet with congratulations.

This commit is contained in:
adilallo committed 2026-11-22 18:01:56 -07:00
1 parent a2815ae05f
commit 851133e56d
11 files changed
+150 -23

No files matched your search

@@ -3,7 +3,11 @@
import { useCallback, useState } from "react";
import { buildPublishPayload } from "../../../../lib/create/buildPublishPayload";
import { stateWithPendingCommunityAvatar } from "../../../../lib/create/flushPendingCommunityAvatar";
import { publishRule, updatePublishedRule } from "../../../../lib/create/api";
import {
deleteServerDraft,
publishRule,
updatePublishedRule,
} from "../../../../lib/create/api";
import { writeLastPublishedRule } from "../../../../lib/create/lastPublishedRule";
import { writePendingKeepRuleLogin } from "../../../../lib/create/pendingKeepRuleLogin";
import messages from "../../../../messages/en/index";
@@ -150,6 +154,7 @@ export function useCreateFlowFinalize({
document: ruleDocument,
});
updateState({ editingPublishedRuleId: undefined });
void deleteServerDraft();
router.push(createFlowStepPath("completed"));
return;
}
@@ -203,6 +208,8 @@ export function useCreateFlowFinalize({
if (isGuest) {
writePendingKeepRuleLogin();
onGuestPublished?.({ skippedInvites: skippedGuestInvites });
} else {
void deleteServerDraft();
}
router.push(
createFlowStepPath("completed", {