mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-13 16:02:59 +00:00
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
18 lines
574 B
TypeScript
18 lines
574 B
TypeScript
import { WORKSPACE_SLACK_BOT_TOKEN_PATH } from '$lib/consts'
|
|
|
|
const AUTO_SLACK_ARG = '$res:' + WORKSPACE_SLACK_BOT_TOKEN_PATH
|
|
|
|
// `slack` belongs to the Slack built-in only while it holds the value the picker set; any other
|
|
// value is a custom handler's own argument and must survive handler switches and reloads.
|
|
export function syncSlackBotArg(
|
|
args: Record<string, any>,
|
|
isSlackBuiltin: boolean,
|
|
wasSlackBuiltin: boolean
|
|
) {
|
|
if (isSlackBuiltin) {
|
|
args.slack = AUTO_SLACK_ARG
|
|
} else if (wasSlackBuiltin && args.slack === AUTO_SLACK_ARG) {
|
|
delete args.slack
|
|
}
|
|
}
|