Skip to content

Commit 7d0a576

Browse files
Enable PWA on production (#1195)
Remove it locally as the SW code bails in that scenario anyway.
1 parent 46c2580 commit 7d0a576

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/flags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const allFlags: FlagMetadata[] = [
6969
{ name: "noWelcome", defaultOnStages: ["local", "REVIEW"] },
7070
{
7171
name: "pwa",
72-
defaultOnStages: ["local", "REVIEW", "STAGING"],
72+
defaultOnStages: ["REVIEW", "STAGING", "PRODUCTION"],
7373
},
7474
];
7575

src/simulator/Simulator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Simulator = ({
4646
const [brand500] = useToken("colors", ["brand.500"]);
4747
const url = useMemo(() => {
4848
const production =
49-
"https://python-simulator.usermbit.org/v/0.1/simulator.html";
49+
"https://python-simulator.usermbit.org/v/0.1/simulator.html?flag=sw";
5050
const staging =
5151
"https://python-simulator.usermbit.org/staging/simulator.html?flag=sw";
5252

src/workbench/flags.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ describe("flags", () => {
1414
expect(flags.dndDebug).toEqual(false);
1515
});
1616

17-
it("enables nothing in production", () => {
17+
it("only enables PWA in production", () => {
1818
const params = new URLSearchParams([]);
1919

2020
const flags = flagsForParams("PRODUCTION", params);
2121

22-
expect(Object.values(flags).every((x) => !x)).toEqual(true);
22+
expect(flags.pwa).toBe(true);
23+
const { pwa, ...filteredFlags } = flags;
24+
25+
expect(Object.values(filteredFlags).every((x) => !x)).toEqual(true);
2326
});
2427

2528
it("enable specific flag", () => {
@@ -29,7 +32,7 @@ describe("flags", () => {
2932

3033
expect(
3134
Object.entries(flags).every(
32-
([flag, status]) => (flag === "noWelcome") === status
35+
([flag, status]) => (flag === "noWelcome" || flag === "pwa") === status
3336
)
3437
).toEqual(true);
3538
});

0 commit comments

Comments
 (0)