mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
Actually open the note
This commit is contained in:
parent
f909fe6670
commit
0a6390ed96
@ -363,7 +363,9 @@ export default class ElectronAppWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onUrl(url: string) {
|
async onUrl(url: string) {
|
||||||
console.log(`on url: ${url}`);
|
this.win_.webContents.send('asynchronous-message', 'openUrl', {
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import RevisionService from '@joplin/lib/services/RevisionService';
|
|||||||
import MigrationService from '@joplin/lib/services/MigrationService';
|
import MigrationService from '@joplin/lib/services/MigrationService';
|
||||||
import { loadCustomCss, injectCustomStyles } from '@joplin/lib/CssUtils';
|
import { loadCustomCss, injectCustomStyles } from '@joplin/lib/CssUtils';
|
||||||
// import populateDatabase from '@joplin/lib/services/debug/populateDatabase';
|
// import populateDatabase from '@joplin/lib/services/debug/populateDatabase';
|
||||||
|
const ipcRenderer = require('electron').ipcRenderer;
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
require('./gui/MainScreen/commands/editAlarm'),
|
require('./gui/MainScreen/commands/editAlarm'),
|
||||||
@ -161,6 +162,27 @@ class Application extends BaseApplication {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this.bridge_nativeThemeUpdated = this.bridge_nativeThemeUpdated.bind(this);
|
this.bridge_nativeThemeUpdated = this.bridge_nativeThemeUpdated.bind(this);
|
||||||
|
|
||||||
|
ipcRenderer.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
||||||
|
if (message === 'openUrl') {
|
||||||
|
const noteId = (args.url as string).substring('joplin://'.length);
|
||||||
|
console.log(`open note ${noteId}`);
|
||||||
|
|
||||||
|
CommandService.instance().execute('openNote', noteId);
|
||||||
|
// const item = Note
|
||||||
|
// this.store().dispatch({
|
||||||
|
// type: 'FOLDER_AND_NOTE_SELECT',
|
||||||
|
// folderId: item.parent_id,
|
||||||
|
// noteId: item.id,
|
||||||
|
// });
|
||||||
|
// this.store().dispatch({
|
||||||
|
// type: 'NAV_GO',
|
||||||
|
// routeName: 'Note',
|
||||||
|
// noteId: noteId,
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasGui() {
|
hasGui() {
|
||||||
|
Loading…
Reference in New Issue
Block a user