IssueReporterViewModel
class IssueReporterViewModel(repository: IssueReporterRepository, historyRepository: IssueReportHistoryRepository, validateReport: ValidateIssueReportUseCase, githubTarget: GithubTarget, githubToken: String, telemetryRepository: TelemetryRepository) : LoggedScreenViewModel<IssueReporterUiState, IssueReporterEvent> (source)
Owns the report draft and submission state. Form fields survive submission and are cleared on dismissal; a reset requested during sending is deferred until that send finishes. Success is rendered by the confirmation state rather than a transient message.
A send passes three gates before it reaches GitHub: validateReport, whose errors show under the fields, then the cooldown and the duplicate check of historyRepository, which show as a message. Each attempt is logged once as send_issue with the gate that stopped it.
Both repositories are main-safe, so this needs no dispatcher.
Constructors
Link copied to clipboard
constructor(repository: IssueReporterRepository, historyRepository: IssueReportHistoryRepository, validateReport: ValidateIssueReportUseCase, githubTarget: GithubTarget, githubToken: String, telemetryRepository: TelemetryRepository)