From 27bcf6badb686d9fd3fd345af677a0c3289e11c5 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Wed, 4 Mar 2020 19:37:32 +0000 Subject: [PATCH] Desktop: Fixes #2660: Templates when creating note were broken --- ElectronClient/gui/MainScreen.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ElectronClient/gui/MainScreen.jsx b/ElectronClient/gui/MainScreen.jsx index e4d5abbef..34a28d864 100644 --- a/ElectronClient/gui/MainScreen.jsx +++ b/ElectronClient/gui/MainScreen.jsx @@ -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({