mirror of
https://github.com/frappe/books.git
synced 2025-03-19 17:42:23 +00:00
fix: currency sigil not appearing post setup
This commit is contained in:
parent
45e0af46f3
commit
3dd7c2e1c7
@ -37,13 +37,13 @@ export default async function postStart() {
|
|||||||
await frappe.getSingle('GetStarted');
|
await frappe.getSingle('GetStarted');
|
||||||
|
|
||||||
// cache currency symbols for frappe.format
|
// cache currency symbols for frappe.format
|
||||||
frappe.currencySymbols = await getCurrencySymbols();
|
await setCurrencySymbols();
|
||||||
|
|
||||||
registerServerMethods();
|
registerServerMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrencySymbols() {
|
export async function setCurrencySymbols() {
|
||||||
return frappe.db
|
frappe.currencySymbols = await frappe.db
|
||||||
.getAll({
|
.getAll({
|
||||||
doctype: 'Currency',
|
doctype: 'Currency',
|
||||||
fields: ['name', 'symbol'],
|
fields: ['name', 'symbol'],
|
||||||
|
14
src/App.vue
14
src/App.vue
@ -15,7 +15,7 @@
|
|||||||
/>
|
/>
|
||||||
<SetupWizard
|
<SetupWizard
|
||||||
v-if="activeScreen === 'SetupWizard'"
|
v-if="activeScreen === 'SetupWizard'"
|
||||||
@setup-complete="showSetupWizardOrDesk(true)"
|
@setup-complete="setupComplete"
|
||||||
@setup-canceled="setupCanceled"
|
@setup-canceled="setupCanceled"
|
||||||
/>
|
/>
|
||||||
<div id="toast-container" class="absolute bottom-0 right-0 mr-6 mb-3">
|
<div id="toast-container" class="absolute bottom-0 right-0 mr-6 mb-3">
|
||||||
@ -34,7 +34,11 @@ import WindowsTitleBar from '@/components/WindowsTitleBar';
|
|||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
import { IPC_MESSAGES, IPC_ACTIONS } from '@/messages';
|
import { IPC_MESSAGES, IPC_ACTIONS } from '@/messages';
|
||||||
import { connectToLocalDatabase, purgeCache } from '@/initialization';
|
import {
|
||||||
|
connectToLocalDatabase,
|
||||||
|
postSetup,
|
||||||
|
purgeCache,
|
||||||
|
} from '@/initialization';
|
||||||
import { routeTo } from './utils';
|
import { routeTo } from './utils';
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
import { showErrorDialog } from './errorHandling';
|
import { showErrorDialog } from './errorHandling';
|
||||||
@ -78,7 +82,7 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (connectionSuccess) {
|
if (connectionSuccess) {
|
||||||
this.showSetupWizardOrDesk();
|
this.showSetupWizardOrDesk(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,6 +96,10 @@ export default {
|
|||||||
this.activeScreen = 'DatabaseSelector';
|
this.activeScreen = 'DatabaseSelector';
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async setupComplete() {
|
||||||
|
await postSetup();
|
||||||
|
await this.showSetupWizardOrDesk(true);
|
||||||
|
},
|
||||||
async showSetupWizardOrDesk(resetRoute = false) {
|
async showSetupWizardOrDesk(resetRoute = false) {
|
||||||
const { setupComplete } = frappe.AccountingSettings;
|
const { setupComplete } = frappe.AccountingSettings;
|
||||||
if (!setupComplete) {
|
if (!setupComplete) {
|
||||||
|
@ -3,9 +3,9 @@ import SQLiteDatabase from 'frappe/backends/sqlite';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import models from '../models';
|
import models from '../models';
|
||||||
import regionalModelUpdates from '../models/regionalModelUpdates';
|
import regionalModelUpdates from '../models/regionalModelUpdates';
|
||||||
import postStart from '../server/postStart';
|
import postStart, { setCurrencySymbols } from '../server/postStart';
|
||||||
import { DB_CONN_FAILURE } from './messages';
|
import { DB_CONN_FAILURE } from './messages';
|
||||||
import migrate from './migrate';
|
import runMigrate from './migrate';
|
||||||
import { callInitializeMoneyMaker, getSavePath } from './utils';
|
import { callInitializeMoneyMaker, getSavePath } from './utils';
|
||||||
|
|
||||||
export async function createNewDatabase() {
|
export async function createNewDatabase() {
|
||||||
@ -59,7 +59,7 @@ export async function connectToLocalDatabase(filePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await migrate();
|
await runMigrate();
|
||||||
await postStart();
|
await postStart();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!error.message.includes('SQLITE_CANTOPEN')) {
|
if (!error.message.includes('SQLITE_CANTOPEN')) {
|
||||||
@ -113,3 +113,7 @@ export function purgeCache(purgeAll = false) {
|
|||||||
frappe.initializeAndRegister(models, true);
|
frappe.initializeAndRegister(models, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function postSetup() {
|
||||||
|
await setCurrencySymbols();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user