2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 03:29:00 +00:00

fix: test, run updatetemplates only if electron

- fix prop of null not found error
This commit is contained in:
18alantom 2023-05-30 10:21:48 +05:30 committed by Alan
parent f6cc795184
commit 497d2bbd34
4 changed files with 11 additions and 7 deletions

View File

@ -115,8 +115,8 @@ const routes: RouteRecordRaw[] = [
const router = createRouter({ routes, history: createWebHistory() }); const router = createRouter({ routes, history: createWebHistory() });
router.afterEach(() => { router.afterEach(() => {
historyState.forward = !!history.state.forward; historyState.forward = !!history.state?.forward;
historyState.back = !!history.state.back; historyState.back = !!history.state?.back;
}); });
export default router; export default router;

View File

@ -21,7 +21,6 @@ import {
initializeInstance, initializeInstance,
setCurrencySymbols, setCurrencySymbols,
} from 'src/utils/initialization'; } from 'src/utils/initialization';
import { updatePrintTemplates } from 'src/utils/printTemplates';
import { getRandomString } from 'utils'; import { getRandomString } from 'utils';
import { getDefaultLocations, getDefaultUOMs } from 'utils/defaults'; import { getDefaultLocations, getDefaultUOMs } from 'utils/defaults';
import { getCountryCodeFromCountry, getCountryInfo } from 'utils/misc'; import { getCountryCodeFromCountry, getCountryInfo } from 'utils/misc';
@ -49,7 +48,11 @@ export default async function setupInstance(
await createDefaultEntries(fyo); await createDefaultEntries(fyo);
await createDefaultNumberSeries(fyo); await createDefaultNumberSeries(fyo);
await updateInventorySettings(fyo); await updateInventorySettings(fyo);
await updatePrintTemplates(fyo);
if (fyo.isElectron) {
const { updatePrintTemplates } = await import('src/utils/printTemplates');
await updatePrintTemplates(fyo);
}
await completeSetup(companyName, fyo); await completeSetup(companyName, fyo);
if (!Object.keys(fyo.currencySymbols).length) { if (!Object.keys(fyo.currencySymbols).length) {

View File

@ -59,6 +59,7 @@ input[type='number']::-webkit-inner-spin-button {
} }
:root { :root {
--w-form: 600px;
--w-app: 1200px; --w-app: 1200px;
--w-sidebar: 12rem; --w-sidebar: 12rem;
--w-desk: calc(100vw - var(--w-sidebar)); --w-desk: calc(100vw - var(--w-sidebar));
@ -87,7 +88,7 @@ input[type='number']::-webkit-inner-spin-button {
} }
.w-form { .w-form {
width: 600px; width: var(--w-form);
} }
.w-dialog { .w-dialog {

View File

@ -4,6 +4,6 @@ export const showSidebar = ref(true);
export const docsPathRef = ref<string>(''); export const docsPathRef = ref<string>('');
export const systemLanguageRef = ref<string>(''); export const systemLanguageRef = ref<string>('');
export const historyState = reactive({ export const historyState = reactive({
forward: !!history.state.forward, forward: !!history.state?.forward,
back: !!history.state.back, back: !!history.state?.back,
}); });