Skip to content

Commit 5fb7d77

Browse files
committed
fix: add consumer default hint, use stable stringify for dirty check
1 parent 5d6518b commit 5fb7d77

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/webapp/app/routes/admin.feature-flags.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useFetcher } from "@remix-run/react";
22
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/server-runtime";
33
import { useEffect, useState } from "react";
4+
import stableStringify from "json-stable-stringify";
45
import { json } from "@remix-run/server-runtime";
56
import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson";
67
import { prisma } from "~/db.server";
@@ -88,7 +89,7 @@ export default function AdminFeatureFlagsRoute() {
8889
}
8990
}, [saveFetcher.data]);
9091

91-
const isDirty = JSON.stringify(values) !== JSON.stringify(initialValues);
92+
const isDirty = stableStringify(values) !== stableStringify(initialValues);
9293
const isSaving = saveFetcher.state === "submitting";
9394

9495
const setFlagValue = (key: string, value: unknown) => {
@@ -117,6 +118,7 @@ export default function AdminFeatureFlagsRoute() {
117118
<div className="max-w-2xl space-y-4">
118119
<p className="text-sm text-text-dimmed">
119120
Global defaults for all organizations. Org-level overrides take precedence.
121+
When not set, each consumer uses its own default.
120122
</p>
121123

122124
<div className="flex flex-col gap-1.5">

0 commit comments

Comments
 (0)