refactor(issue): share the prompt policy check of issue forms

issue create, issue edit and comment prompts ask canPrompt, like the
milestone and label forms, instead of loading the settings themselves.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 00:17:08 +02:00
1 parent 01ced23a4a
commit 511252e2a5
3 files changed
+10 -12

No files matched your search

+2 -2
View File
@@ -244,11 +244,11 @@ $ tea issue create --title "Idea" --web`, Args: argsExact(0), RunE: func(cmd *co
return err
}
}
snapshot, err := a.deps.Settings.Load()
prompt, err := a.canPrompt()
if err != nil {
return err
}
if !localFlagsChanged(cmd) && a.policy(snapshot).CanPrompt(a.deps.Streams) && a.deps.IssueForm != nil {
if !localFlagsChanged(cmd) && prompt && a.deps.IssueForm != nil {
return a.createIssueInteractively(cmd)
}
var target target