fixes, cleaned up noise in the developer console

This commit is contained in:
zadam 2020-02-08 10:40:58 +01:00
parent 9acf723a9a
commit 81f4966a1a
12 changed files with 45 additions and 36 deletions

View file

@ -44,4 +44,6 @@ app.on('will-quit', () => {
globalShortcut.unregisterAll();
});
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
require('./src/www');

File diff suppressed because one or more lines are too long

31
package-lock.json generated
View file

@ -639,9 +639,12 @@
"integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA=="
},
"agent-base": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz",
"integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g=="
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz",
"integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==",
"requires": {
"debug": "4"
}
},
"ajv": {
"version": "6.10.2",
@ -2015,9 +2018,9 @@
}
},
"cross-zip": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/cross-zip/-/cross-zip-2.1.6.tgz",
"integrity": "sha512-xLIETNkzRcU6jGRzenJyRFxahbtP4628xEKMTI/Ql0Vu8m4h8M7uRLVi7E5OYHuJ6VQPsG4icJumKAFUvfm0+A==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cross-zip/-/cross-zip-3.0.0.tgz",
"integrity": "sha512-cm+l8PJ6WiSQmKZ/x8DGvUm2u/3FX2JFs1AFd18gdHaVhP5Lf4oE6Jrj2Jd05JYSioz5x+nIRVp0zBQuzuCRcQ==",
"dev": true,
"requires": {
"rimraf": "^3.0.0"
@ -3089,14 +3092,14 @@
}
},
"electron-packager": {
"version": "14.2.0",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-14.2.0.tgz",
"integrity": "sha512-6JHv0zfRpxpFta4MJBt7RtcS6zhtl4f76ombZKqicgl5I3Ighx8WBQRYUKMdAO3tNYEq/B0i1FYsBp6oXzlTfA==",
"version": "14.2.1",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-14.2.1.tgz",
"integrity": "sha512-g6y3BVrAOz/iavKD+VMFbehrQcwCWuA3CZvVbmmbQuCfegGA1ytwWn0BNIDDrEdbuz31Fti7mnNHhb5L+3Wq9A==",
"dev": true,
"requires": {
"@electron/get": "^1.6.0",
"asar": "^2.0.1",
"cross-zip": "^2.1.5",
"cross-zip": "^3.0.0",
"debug": "^4.0.1",
"electron-notarize": "^0.2.0",
"electron-osx-sign": "^0.4.11",
@ -4876,11 +4879,11 @@
}
},
"https-proxy-agent": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz",
"integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
"integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
"requires": {
"agent-base": "5",
"agent-base": "6",
"debug": "4"
}
},

View file

@ -43,7 +43,7 @@
"html": "1.0.0",
"html2plaintext": "2.1.2",
"http-proxy-agent": "4.0.0",
"https-proxy-agent": "4.0.0",
"https-proxy-agent": "5.0.0",
"image-type": "4.1.0",
"imagemin": "7.0.1",
"imagemin-giflossy": "5.1.10",
@ -78,7 +78,7 @@
"devDependencies": {
"electron": "8.0.0",
"electron-builder": "22.3.2",
"electron-packager": "14.2.0",
"electron-packager": "14.2.1",
"electron-rebuild": "1.10.0",
"jsdoc": "3.6.3",
"lorem-ipsum": "2.0.3"

View file

@ -32,6 +32,8 @@ import options from "./services/options.js";
import noteContentRenderer from "./services/note_content_renderer.js";
import appContext from "./services/app_context.js";
window.glob.PROFILING_LOG = false;
window.glob.isDesktop = utils.isDesktop;
window.glob.isMobile = utils.isMobile;

View file

@ -176,7 +176,7 @@ export default class LinkMap {
.addClass('link-' + edge.target.id);
}
else {
console.log(`connection not created for`, edge);
console.debug(`connection not created for`, edge);
}
});

View file

@ -78,7 +78,9 @@ async function call(method, url, data, headers = {}) {
const end = Date.now();
console.log(`${method} ${url} took ${end-start}ms`);
if (glob.PROFILING_LOG) {
console.log(`${method} ${url} took ${end - start}ms`);
}
const maxSyncIdStr = resp.headers['trilium-max-sync-id'];

View file

@ -88,7 +88,7 @@ class TabContext extends Component {
}
isActive() {
return this.appContext.activeTabId === this.tabId;
return this.tabManager.activeTabId === this.tabId;
}
getTabState() {
@ -99,7 +99,7 @@ class TabContext extends Component {
return {
tabId: this.tabId,
notePath: this.notePath,
active: this.appContext.activeTabId === this.tabId
active: this.tabManager.activeTabId === this.tabId
}
}

View file

@ -32,6 +32,18 @@ export default class CalendarWidget extends CollapsibleWidget {
&& this.note.hasOwnedLabel("dateNote");
}
setTabContextListener({tabContext}) {
super.setTabContextListener({tabContext});
console.log("set tab context", tabContext.tabId, "to", this.componentId);
}
async refresh() {
super.refresh();
//console.trace("tab", this.tabContext.tabId);
}
async doRenderBody() {
await libraryLoader.requireLibrary(libraryLoader.CALENDAR_WIDGET);

View file

@ -28,7 +28,7 @@ export default class Component {
const end = Date.now();
if (end - start > 10) {
if (end - start > 10 && glob.PROFILING_LOG) {
console.log(`Event ${name} in component ${this.componentId} took ${end-start}ms`);
}

View file

@ -44,7 +44,7 @@ export default class TabAwareWidget extends BasicWidget {
}
async isEnabled() {
return !!this.note;
return !!this.note && this.tabContext.isActive();
}
async refresh() {
@ -56,7 +56,7 @@ export default class TabAwareWidget extends BasicWidget {
const end = Date.now();
if (end - start > 10) {
if (glob.PROFILING_LOG && end - start > 10) {
console.log(`Refresh of ${this.componentId} took ${end-start}ms`);
}
}

View file

@ -409,12 +409,6 @@ export default class TabRowWidget extends BasicWidget {
});
}
get activeTabId() {
const tabEl = this.activeTabEl;
return tabEl ? tabEl.getAttribute('data-tab-id') : null;
}
get activeTabEl() {
return this.$widget.find('.note-tab[active]')[0];
}