Skip to content

Commit

Permalink
fix flag logic
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Oct 16, 2024
1 parent 087ec77 commit 7fc7ce1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion convex/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};
},
});
3 changes: 2 additions & 1 deletion convex/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 7fc7ce1

Please sign in to comment.