From 7fc7ce11f316b50827871b56d20b07f90a6bc14f Mon Sep 17 00:00:00 2001 From: Cody Seibert Date: Wed, 16 Oct 2024 17:35:20 -0400 Subject: [PATCH] fix flag logic --- convex/flags.ts | 2 +- convex/games.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/convex/flags.ts b/convex/flags.ts index fe30cef..55619f3 100644 --- a/convex/flags.ts +++ b/convex/flags.ts @@ -4,7 +4,7 @@ export const getFlags = query({ args: {}, handler: async (ctx) => { return { - showTestPage: process.env.NODE_ENV === "development", + showTestPage: process.env.FLAG_TEST_PAGE === "true", }; }, }); diff --git a/convex/games.ts b/convex/games.ts index f43bea4..21ebf6c 100644 --- a/convex/games.ts +++ b/convex/games.ts @@ -10,8 +10,9 @@ export const testModel = mutation({ }, handler: async (ctx, args) => { const flags = await ctx.runQuery(api.flags.getFlags); + if (!flags?.showTestPage) { - return "test"; + throw new Error("Test page is not enabled"); } const gameId = (await ctx.runMutation(internal.games.startNewGame, {