diff --git a/src/router.ts b/src/router.ts index a467e87b..27a1e142 100644 --- a/src/router.ts +++ b/src/router.ts @@ -115,8 +115,8 @@ const routes: RouteRecordRaw[] = [ const router = createRouter({ routes, history: createWebHistory() }); router.afterEach(() => { - historyState.forward = !!history.state.forward; - historyState.back = !!history.state.back; + historyState.forward = !!history.state?.forward; + historyState.back = !!history.state?.back; }); export default router; diff --git a/src/setup/setupInstance.ts b/src/setup/setupInstance.ts index ac32dd14..9baa8643 100644 --- a/src/setup/setupInstance.ts +++ b/src/setup/setupInstance.ts @@ -21,7 +21,6 @@ import { initializeInstance, setCurrencySymbols, } from 'src/utils/initialization'; -import { updatePrintTemplates } from 'src/utils/printTemplates'; import { getRandomString } from 'utils'; import { getDefaultLocations, getDefaultUOMs } from 'utils/defaults'; import { getCountryCodeFromCountry, getCountryInfo } from 'utils/misc'; @@ -49,7 +48,11 @@ export default async function setupInstance( await createDefaultEntries(fyo); await createDefaultNumberSeries(fyo); await updateInventorySettings(fyo); - await updatePrintTemplates(fyo); + + if (fyo.isElectron) { + const { updatePrintTemplates } = await import('src/utils/printTemplates'); + await updatePrintTemplates(fyo); + } await completeSetup(companyName, fyo); if (!Object.keys(fyo.currencySymbols).length) { diff --git a/src/styles/index.css b/src/styles/index.css index 0dc8b9d6..241bde62 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -59,6 +59,7 @@ input[type='number']::-webkit-inner-spin-button { } :root { + --w-form: 600px; --w-app: 1200px; --w-sidebar: 12rem; --w-desk: calc(100vw - var(--w-sidebar)); @@ -87,7 +88,7 @@ input[type='number']::-webkit-inner-spin-button { } .w-form { - width: 600px; + width: var(--w-form); } .w-dialog { diff --git a/src/utils/refs.ts b/src/utils/refs.ts index 613ddad7..2beabadc 100644 --- a/src/utils/refs.ts +++ b/src/utils/refs.ts @@ -4,6 +4,6 @@ export const showSidebar = ref(true); export const docsPathRef = ref(''); export const systemLanguageRef = ref(''); export const historyState = reactive({ - forward: !!history.state.forward, - back: !!history.state.back, + forward: !!history.state?.forward, + back: !!history.state?.back, });