Skip to content

Commit

Permalink
Fix color scheme observer crashes in Safari (#249)
Browse files Browse the repository at this point in the history
Resolve #245. Turns out `matchMediaDarkScheme` object doesn't have `addEventListener`, but only `addListener` in Safari 13.1.2.
  • Loading branch information
MaxDesiatov authored Aug 5, 2020
1 parent c4c9eb5 commit de37894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/TokamakDOM/App/ColorSchemeObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum ColorSchemeObserver {
publisher.value = .init(matchMediaDarkScheme: $0[0].object!)
return .undefined
}
_ = matchMediaDarkScheme.addEventListener!("change", closure)
_ = matchMediaDarkScheme.addListener!(closure)
Self.closure = closure
}
}

0 comments on commit de37894

Please sign in to comment.