3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-11 13:07:20 +00:00

compact locked triggers

This commit is contained in:
metal 2021-09-14 14:51:22 +00:00 committed by almeidx
parent 25573b10d7
commit e52db4dcd2
No known key found for this signature in database
GPG key ID: F403F80B79353CB4
5 changed files with 14 additions and 120 deletions

View file

@ -15,6 +15,7 @@ interface ThreadArchiveResult {
export const ThreadArchiveTrigger = automodTrigger<ThreadArchiveResult>()({
configType: t.type({
parent: tNullable(t.union([t.string, t.array(t.string)])),
locked: tNullable(t.boolean),
}),
defaultConfig: {},
@ -24,6 +25,12 @@ export const ThreadArchiveTrigger = automodTrigger<ThreadArchiveResult>()({
return;
}
if (triggerConfig.locked && !context.threadChange.locked) {
return;
} else if (triggerConfig.locked === false && !context.threadChange.unlocked) {
return;
}
const thread = context.threadChange.archived;
if (triggerConfig.parent) {