Skip to content

Commit 433e4d7

Browse files
refactor: replace getFlag function with fetch call to retrieve feature flag status
1 parent bf4bced commit 433e4d7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/app/weather-widget.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { getFlag } from "../flags";
2-
31
export default async function WeatherWidget() {
4-
const isEnabled = await getFlag("WeatherWidgetEnabled");
2+
const res = await fetch("/api/flags");
3+
const { isEnabled } = await res.json();
54

65
if (!isEnabled) {
76
return null; // Do not render the widget if the flag is disabled

0 commit comments

Comments
 (0)