Open a finished Rule from its Profile card, and drop it from the browser on Log out.
This commit is contained in:
1 parent
db1599123b
commit
942c7cc9de
17 files changed
+280
-14
No files matched your search
@@ -23,7 +23,9 @@ import {
|
||||
downloadStoredRuleAsPdf,
|
||||
} from "../../../lib/create/ruleExport";
|
||||
import {
|
||||
clearLastPublishedRule,
|
||||
finishedAtIso,
|
||||
readLastPublishedRule,
|
||||
writeLastPublishedRule,
|
||||
type StoredLastPublishedRule,
|
||||
} from "../../../lib/create/lastPublishedRule";
|
||||
@@ -36,6 +38,7 @@ import {
|
||||
} from "../create/utils/flowSteps";
|
||||
import type { CreateFlowStep } from "../create/types";
|
||||
import { clearAnonymousCreateFlowStorage } from "../create/utils/anonymousDraftStorage";
|
||||
import { clearBrowserRuleData } from "../create/utils/clearBrowserRuleData";
|
||||
import { clearCoreValueDetailsLocalStorage } from "../create/utils/coreValueDetailsLocalStorage";
|
||||
import { prepareFreshCreateFlowEntrySync } from "../create/utils/prepareFreshCreateFlowEntry";
|
||||
import { createFlowStepPath } from "../create/utils/createFlowPaths";
|
||||
@@ -203,6 +206,7 @@ export default function ProfilePageClient() {
|
||||
const handleSignOut = useCallback(async () => {
|
||||
setActionError(null);
|
||||
await logout();
|
||||
clearBrowserRuleData();
|
||||
setUser(null);
|
||||
setRules([]);
|
||||
setDraft(null);
|
||||
@@ -228,6 +232,8 @@ export default function ProfilePageClient() {
|
||||
const res = await deletePublishedRule(id);
|
||||
setRuleDeleteBusy(false);
|
||||
if (res.ok === true) {
|
||||
const stored = readLastPublishedRule();
|
||||
if (stored?.id === id) clearLastPublishedRule();
|
||||
setRuleDeleteTargetId(null);
|
||||
void load();
|
||||
return;
|
||||
@@ -392,6 +398,7 @@ export default function ProfilePageClient() {
|
||||
const res = await deleteAccount();
|
||||
setAccountDeleteBusy(false);
|
||||
if (res.ok) {
|
||||
clearBrowserRuleData();
|
||||
setAccountDeleteOpen(false);
|
||||
setUser(null);
|
||||
setRules([]);
|
||||
|
||||
Reference in new issue
Block a user