From 9a4f4cbb652aa32f4be97fc42d2bb7c47e621665 Mon Sep 17 00:00:00 2001 From: Caleb John Date: Thu, 29 Aug 2019 10:34:54 -0600 Subject: [PATCH] Desktop: Change template prompt to sans and sort templates (#1806) * Change template prompt to sans and sort templates * Sort templates by filename to ensure order --- ElectronClient/app/gui/PromptDialog.jsx | 1 + ReactNativeClient/lib/TemplateUtils.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ElectronClient/app/gui/PromptDialog.jsx b/ElectronClient/app/gui/PromptDialog.jsx index 19b1e7a2d9..9c217f3e6c 100644 --- a/ElectronClient/app/gui/PromptDialog.jsx +++ b/ElectronClient/app/gui/PromptDialog.jsx @@ -104,6 +104,7 @@ class PromptDialog extends React.Component { Object.assign(provided, { minWidth: width * 0.2, maxWidth: width * 0.5, + fontFamily: theme.fontFamily, }), input: provided => Object.assign(provided, { diff --git a/ReactNativeClient/lib/TemplateUtils.js b/ReactNativeClient/lib/TemplateUtils.js index 37426e5683..2986cee2fe 100644 --- a/ReactNativeClient/lib/TemplateUtils.js +++ b/ReactNativeClient/lib/TemplateUtils.js @@ -41,6 +41,10 @@ TemplateUtils.loadTemplates = async function(filePath) { throw error; } + // Make sure templates are always in the same order + // sensitivity ensures that the sort will ignore case + files.sort((a, b) => { return a.path.localeCompare(b.path, undefined, {sensitivity: 'accent'}); }); + files.forEach(async file => { if (file.path.endsWith('.md')) { try {