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, {