Skip to content

Commit

Permalink
chore: link buttons need to be ack'd
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-run committed Jan 20, 2025
1 parent 3d944a8 commit 0bd59e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/bot/events/healthcheck/healthcheck-event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import { botLogger } from '../../bot-logger'
import { createHealthCheckModal, getIdValueFromAnswer, HealthcheckModalActions } from './healthcheck-modal-builder'

export function configureHealthCheckEventsHandler(app: App): void {
// User clicks the link to the graph, only needs to ack
app.action(MessageActions.LinkButtonClicked, async ({ ack }) => {
await ack()
})

// User clicks fill out helsesjekk button, so we open the modal with the form
app.action(MessageActions.FillButtonClicked, async ({ ack, action, body, client }) => {
botLogger.info(`User clicked fill out helsesjekk button, opening modal`)
Expand Down
3 changes: 2 additions & 1 deletion src/bot/messages/message-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { QuestionType } from '../../safe-types'

export const MessageActions = {
FillButtonClicked: 'open_health_check_modal-action',
LinkButtonClicked: 'open_graph_link_message-action',
}

/**
Expand Down Expand Up @@ -114,7 +115,7 @@ export function createScoreBlocks(
},
value: 'helsesjekk-link-button',
url: `https://helsesjekk-bot.nav.no/team/${team.assosiatedGroup}/${team.id}/graph`,
action_id: 'button-action',
action_id: MessageActions.LinkButtonClicked,
},
})),
{
Expand Down

0 comments on commit 0bd59e1

Please sign in to comment.