mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] app: only log dev message once
Before this commit, it was logged for every app created, which is annoying in odoo: because of the compatibility layer, there are many apps being created.
This commit is contained in:
committed by
Samuel Degueldre
parent
d6348b8310
commit
6908102a72
+4
-1
@@ -18,6 +18,8 @@ export interface AppConfig<P, E> extends TemplateSetConfig {
|
|||||||
test?: boolean;
|
test?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let hasBeenLogged = false;
|
||||||
|
|
||||||
export const DEV_MSG = () => {
|
export const DEV_MSG = () => {
|
||||||
const hash = (window as any).owl ? (window as any).owl.__info__.hash : "master";
|
const hash = (window as any).owl ? (window as any).owl.__info__.hash : "master";
|
||||||
|
|
||||||
@@ -46,8 +48,9 @@ export class App<
|
|||||||
if (config.test) {
|
if (config.test) {
|
||||||
this.dev = true;
|
this.dev = true;
|
||||||
}
|
}
|
||||||
if (this.dev && !config.test) {
|
if (this.dev && !config.test && !hasBeenLogged) {
|
||||||
console.info(DEV_MSG());
|
console.info(DEV_MSG());
|
||||||
|
hasBeenLogged = true;
|
||||||
}
|
}
|
||||||
const descrs = Object.getOwnPropertyDescriptors(config.env || {});
|
const descrs = Object.getOwnPropertyDescriptors(config.env || {});
|
||||||
this.env = Object.freeze(Object.defineProperties({}, descrs)) as E;
|
this.env = Object.freeze(Object.defineProperties({}, descrs)) as E;
|
||||||
|
|||||||
Reference in New Issue
Block a user