|
@ -10,15 +10,11 @@ import { FontAwesomeIcon } from "./libs/fontawesome"; |
|
|
import Camera from "simple-vue-camera"; |
|
|
import Camera from "simple-vue-camera"; |
|
|
import { logger } from "./utils/logger"; |
|
|
import { logger } from "./utils/logger"; |
|
|
|
|
|
|
|
|
const platform = process.env.VITE_PLATFORM; |
|
|
// const platform = process.env.VITE_PLATFORM;
|
|
|
const pwa_enabled = process.env.VITE_PWA_ENABLED === "true"; |
|
|
// const pwa_enabled = process.env.VITE_PWA_ENABLED === "true";
|
|
|
|
|
|
|
|
|
logger.log("Platform", JSON.stringify({ platform })); |
|
|
|
|
|
logger.log("PWA enabled", JSON.stringify({ pwa_enabled })); |
|
|
|
|
|
|
|
|
|
|
|
// Global Error Handler
|
|
|
// Global Error Handler
|
|
|
function setupGlobalErrorHandler(app: VueApp) { |
|
|
function setupGlobalErrorHandler(app: VueApp) { |
|
|
logger.log("[App Init] Setting up global error handler"); |
|
|
|
|
|
app.config.errorHandler = ( |
|
|
app.config.errorHandler = ( |
|
|
err: unknown, |
|
|
err: unknown, |
|
|
instance: ComponentPublicInstance | null, |
|
|
instance: ComponentPublicInstance | null, |
|
@ -38,30 +34,13 @@ function setupGlobalErrorHandler(app: VueApp) { |
|
|
|
|
|
|
|
|
// Function to initialize the app
|
|
|
// Function to initialize the app
|
|
|
export function initializeApp() { |
|
|
export function initializeApp() { |
|
|
logger.log("[App Init] Starting app initialization"); |
|
|
|
|
|
logger.log("[App Init] Platform:", process.env.VITE_PLATFORM); |
|
|
|
|
|
|
|
|
|
|
|
const app = createApp(App); |
|
|
const app = createApp(App); |
|
|
logger.log("[App Init] Vue app created"); |
|
|
|
|
|
|
|
|
|
|
|
app.component("FontAwesome", FontAwesomeIcon).component("camera", Camera); |
|
|
app.component("FontAwesome", FontAwesomeIcon).component("camera", Camera); |
|
|
logger.log("[App Init] Components registered"); |
|
|
|
|
|
|
|
|
|
|
|
const pinia = createPinia(); |
|
|
const pinia = createPinia(); |
|
|
app.use(pinia); |
|
|
app.use(pinia); |
|
|
logger.log("[App Init] Pinia store initialized"); |
|
|
|
|
|
|
|
|
|
|
|
app.use(VueAxios, axios); |
|
|
app.use(VueAxios, axios); |
|
|
logger.log("[App Init] Axios initialized"); |
|
|
|
|
|
|
|
|
|
|
|
app.use(router); |
|
|
app.use(router); |
|
|
logger.log("[App Init] Router initialized"); |
|
|
|
|
|
|
|
|
|
|
|
app.use(Notifications); |
|
|
app.use(Notifications); |
|
|
logger.log("[App Init] Notifications initialized"); |
|
|
|
|
|
|
|
|
|
|
|
setupGlobalErrorHandler(app); |
|
|
setupGlobalErrorHandler(app); |
|
|
logger.log("[App Init] App initialization complete"); |
|
|
|
|
|
|
|
|
|
|
|
return app; |
|
|
return app; |
|
|
} |
|
|
} |
|
|