Skip to content

Commit

Permalink
fix: remove fallback behavior for log modal
Browse files Browse the repository at this point in the history
  • Loading branch information
rutmanz committed Sep 14, 2024
1 parent 3075c80 commit 037fe96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/slack/handlers/actions/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ export const handleOpenLogModal: ActionMiddleware = async ({ body, ack, client }

export const handleSubmitLogModal: ViewMiddleware = async ({ ack, body, view }) => {
// Get the hours and task from the modal
let hours = (parseArgs(view.state.values.time.time.value ?? '').hours || safeParseFloat(view.state.values.time.time.value)) ?? NaN
let hours = parseArgs(view.state.values.time.time.value ?? '').hours
const activity = view.state.values.task.task.value
// Ensure the time values are valid
hours = isNaN(hours) ? 0 : hours
if (hours < 0.1) {
await ack({ response_action: 'errors', errors: { hours: 'Please enter a valid duration' } })
await ack({ response_action: 'errors', errors: { hours: 'Please enter a valid duration (eg. 1h30m)' } })
return
}
if (activity?.trim() == '' || activity == undefined) {
Expand Down

0 comments on commit 037fe96

Please sign in to comment.