2
0
mirror of https://github.com/frappe/books.git synced 2025-02-03 12:38:34 +00:00

feat: allow force initialization

This commit is contained in:
18alantom 2021-12-01 18:21:02 +05:30
parent 8da2332c74
commit e0eeaad677

View File

@ -2,8 +2,8 @@ const Observable = require('./utils/observable');
const utils = require('./utils');
module.exports = {
initializeAndRegister(customModels = {}) {
this.init();
initializeAndRegister(customModels = {}, force = false) {
this.init(force);
const common = require('frappejs/common');
this.registerLibs(common);
const coreModels = require('frappejs/models');
@ -11,8 +11,8 @@ module.exports = {
this.registerModels(customModels);
},
init() {
if (this._initialized) return;
init(force) {
if (this._initialized && !force) return;
this.initConfig();
this.initGlobals();
this.docs = new Observable();