Skip to content

Commit f896f2e

Browse files
hi-ogawaOpenCode
andcommitted
refactor: inline latest mutation check
Co-authored-by: OpenCode <noreply@opencode.ai>
1 parent ed029ce commit f896f2e

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

packages/app/src/app.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,16 @@ export function App() {
141141

142142
const outputs = handleRunMutation.data?.outputs ?? [];
143143

144-
const runIsLatest =
145-
handleRunMutation.submittedAt > handleAudioFileMutation.submittedAt;
146-
const status = runIsLatest
147-
? handleRunMutation.data
148-
? `Done in ${(handleRunMutation.data.durationMs / 1000).toFixed(1)}s`
149-
: ""
150-
: handleAudioFileMutation.isPending
151-
? "decoding..."
152-
: decoded
153-
? `decoded: ${decoded.duration.toFixed(2)}s, ${decoded.numberOfChannels}ch @${decoded.sampleRate / 1000}k`
154-
: "";
144+
const status =
145+
handleRunMutation.submittedAt > handleAudioFileMutation.submittedAt
146+
? handleRunMutation.data
147+
? `Done in ${(handleRunMutation.data.durationMs / 1000).toFixed(1)}s`
148+
: ""
149+
: handleAudioFileMutation.isPending
150+
? "decoding..."
151+
: decoded
152+
? `decoded: ${decoded.duration.toFixed(2)}s, ${decoded.numberOfChannels}ch @${decoded.sampleRate / 1000}k`
153+
: "";
155154

156155
return (
157156
<main className="mx-auto w-full max-w-[800px] px-3 py-9 sm:px-5 sm:py-18 md:pb-24">

0 commit comments

Comments
 (0)