mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-06-09 06:13:14 +00:00
- Extract theme initialization logic from main.ts into useTheme composable - Add setTheme() and initTheme() functions for consistent theme handling - Update ThemePreferences to use useTheme instead of duplicate logic - Remove unused DarkmodeToggle component - Clean up main.ts from ~49 to 28 lines (theme logic now in composable) - Establish single source of truth for theme management - Follow Vue 3 composables pattern for better organization and testability
22 lines
438 B
TypeScript
22 lines
438 B
TypeScript
import { createApp } from "vue";
|
|
import router from "./routes";
|
|
import store from "./store";
|
|
import Toast from "./plugins/Toast";
|
|
import { useTheme } from "./composables/useTheme";
|
|
|
|
import App from "./App.vue";
|
|
|
|
// Initialize theme before mounting
|
|
const { initTheme } = useTheme();
|
|
initTheme();
|
|
|
|
store.dispatch("user/initUserFromCookie");
|
|
|
|
const app = createApp(App);
|
|
|
|
app.use(router);
|
|
app.use(store);
|
|
app.use(Toast);
|
|
|
|
app.mount("#app");
|