Skip to content

Build your personal knowledge base with Trilium Notes

Merge remote-tracking branch 'origin/master' into m42

zadamaff12950f0ec
diff --cc src/public/app/services/app_context.js
index 77e80e1852,f4537f087c..67787988a6
--- a/src/public/app/services/app_context.js
+++ b/src/public/app/services/app_context.js
@@@ -100,28 -94,9 +100,22 @@@ class AppContext extends Component
getComponentByEl(el) {
return $(el).closest(".component").prop('component');
}
+
- async protectedSessionStartedEvent() {
- await treeCache.loadInitialTree();
-
- this.triggerEvent('treeCacheReloaded');
- }
-
+ async openInNewWindow(notePath) {
+ if (utils.isElectron()) {
+ const {ipcRenderer} = utils.dynamicRequire('electron');
+
+ ipcRenderer.send('create-extra-window', {notePath});
+ }
+ else {
+ const url = 'http://127.0.0.1:37740/#' + notePath;
+
+ window.open(url);
+ }
+ }
}
-const appContext = new AppContext();
+const appContext = new AppContext(window.glob.isMainWindow);
// we should save all outstanding changes before the page/app is closed
$(window).on('beforeunload', () => {