mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
fix: delay dark mode loading to bypass vuetify bug (#1877)
This commit is contained in:
parent
6111f9c88c
commit
0e1d778d3a
@ -4,7 +4,10 @@ import { useDark } from "@vueuse/core";
|
||||
const darkModePlugin: Plugin = ({ $vuetify }, _) => {
|
||||
const isDark = useDark();
|
||||
|
||||
$vuetify.theme.dark = isDark.value;
|
||||
// Vuetify metadata is bugged and doesn't render dark mode fully when called immediately
|
||||
// Adding a 0.5 millisecond delay fixes this problem
|
||||
// https://stackoverflow.com/questions/69399797/vuetify-darkmode-colors-wrong-after-page-reload
|
||||
setTimeout( () => { $vuetify.theme.dark = isDark.value; }, 0.5);
|
||||
};
|
||||
|
||||
export default darkModePlugin;
|
||||
|
Loading…
x
Reference in New Issue
Block a user