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:
parent
25573b10d7
commit
e52db4dcd2
5 changed files with 14 additions and 120 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue