mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-26 18:58:21 +02:00
Desktop: Fixes #2660: Templates when creating note were broken
This commit is contained in:
parent
48eb115cb9
commit
27bcf6badb
@ -20,6 +20,7 @@ const { bridge } = require('electron').remote.require('./bridge');
|
||||
const eventManager = require('../eventManager');
|
||||
const VerticalResizer = require('./VerticalResizer.min');
|
||||
const PluginManager = require('lib/services/PluginManager');
|
||||
const TemplateUtils = require('lib/TemplateUtils');
|
||||
|
||||
class MainScreenComponent extends React.Component {
|
||||
constructor() {
|
||||
@ -97,10 +98,12 @@ class MainScreenComponent extends React.Component {
|
||||
const folderId = Setting.value('activeFolderId');
|
||||
if (!folderId) return;
|
||||
|
||||
const body = template ? TemplateUtils.render(template) : '';
|
||||
|
||||
const newNote = await Note.save({
|
||||
parent_id: folderId,
|
||||
is_todo: isTodo ? 1 : 0,
|
||||
template: template,
|
||||
body: body,
|
||||
}, { provisional: true });
|
||||
|
||||
this.props.dispatch({
|
||||
|
Loading…
x
Reference in New Issue
Block a user