Skip to content

Commit 30e74a9

Browse files
committed
fix: load mock data button only when isDev
1 parent 4e8a719 commit 30e74a9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/History.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { mergeThreshold, TimeEntry } from "../electron/types"
55
import { getDuration, midnight, pad2, useEphemeralState } from "./util"
66
import classNames from "classnames"
77
import ipc from "./ipc"
8+
import { isDev } from "./buildInfo"
89

910
export function History() {
1011
const state = useContext(StateContext)
@@ -56,7 +57,7 @@ export function History() {
5657
setConfirmingDeleteAll(true)
5758
}
5859
}}>{confirmingDeleteAll ? "confirm" : "delete all"}</div>}
59-
<div className="_button text-sm -mt-5" onClick={() => ipc.loadMockData()}>load mock data</div>
60+
{isDev && <div className="_button text-sm -mt-5" onClick={() => ipc.loadMockData()}>load mock data</div>}
6061
</div>
6162
</div>
6263
</>

src/buildInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
export const version: string = "{{INJECT: VERSION}}"
55

6-
export const isDev = version === "dev"
6+
export const isDev = version === "(dev)"

0 commit comments

Comments
 (0)