Skip to content
Prev Previous commit
Next Next commit
fix(ios): keep the toast scheduler on the main actor
  • Loading branch information
kyya committed Nov 24, 2026
commit d188bbece80ef469477bc04d983201bbcd0e8040
4 changes: 2 additions & 2 deletions ios/GoRex/Views/Toast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ struct Toast: Identifiable {
var sheetHosts = 0
var rootShows: Bool { sheetHosts == 0 }
/// Starts a countdown, and gives the way to stop it. Tests set their own.
@ObservationIgnored private let schedule: (Double, @escaping @MainActor () -> Void) -> () -> Void
@ObservationIgnored private let schedule: @MainActor (Double, @escaping @MainActor () -> Void) -> () -> Void
/// Tells VoiceOver. It never takes the focus.
@ObservationIgnored private let announce: (String) -> Void
@ObservationIgnored private var stop: (() -> Void)?

init(schedule: @escaping (Double, @escaping @MainActor () -> Void) -> () -> Void = Toasts.sleep,
init(schedule: @escaping @MainActor (Double, @escaping @MainActor () -> Void) -> () -> Void = Toasts.sleep,
announce: @escaping (String) -> Void = { AccessibilityNotification.Announcement($0).post() }) {
self.schedule = schedule
self.announce = announce
Expand Down