Skip to content

Commit 819c51c

Browse files
committed
fix: Faster theme loading to avoid flickering
The tubo:load event is faster than the migration event. The color changing requires no sprocket code and can be controlled without the migration event.
1 parent 773e751 commit 819c51c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/javascript/sprocket-asset-import/color-mode-picker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function showActiveTheme(theme, focus = false) {
7777
}
7878
}
7979

80-
$(document).on('turbo-migration:load', function() {
80+
$(document).on('turbo:load', function() {
8181
setTheme(getPreferredTheme())
8282

8383
showActiveTheme(getPreferredTheme())

0 commit comments

Comments
 (0)