Files
crowd-funder-from-jason/src/main.common.ts
Matthew Raymer 8dd73950f5 Fix duplicate export declarations and migrate ContactsView with sub-components
- Remove duplicate NOTIFY_INVITE_MISSING and NOTIFY_INVITE_PROCESSING_ERROR exports
- Update InviteOneAcceptView.vue to use correct NOTIFY_INVITE_TRUNCATED_DATA constant
- Migrate ContactsView to PlatformServiceMixin and extract into modular sub-components
- Resolves TypeScript compilation errors preventing web build
2025-07-16 08:03:26 +00:00

44 lines
1.3 KiB
TypeScript

import { createPinia } from "pinia";
import { App as VueApp, ComponentPublicInstance, createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import axios from "axios";
import VueAxios from "vue-axios";
import Notifications from "notiwind";
import "./assets/styles/tailwind.css";
import { FontAwesomeIcon } from "./libs/fontawesome";
import Camera from "simple-vue-camera";
import { logger } from "./utils/logger";
// Global Error Handler
function setupGlobalErrorHandler(app: VueApp) {
app.config.errorHandler = (
err: unknown,
instance: ComponentPublicInstance | null,
info: string,
) => {
logger.error("[App Error] Global Error Handler:", {
error: err,
info,
component: instance?.$options.name || "unknown",
});
alert(
(err instanceof Error ? err.message : "Something bad happened") +
" - Try reloading or restarting the app.",
);
};
}
// Function to initialize the app
export function initializeApp() {
const app = createApp(App);
app.component("FontAwesome", FontAwesomeIcon).component("camera", Camera);
const pinia = createPinia();
app.use(pinia);
app.use(VueAxios, axios);
app.use(router);
app.use(Notifications);
setupGlobalErrorHandler(app);
return app;
}