1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Desktop: Fixes #3503: Editor window was no longer being resized with the main window

This commit is contained in:
Laurent Cozic 2020-07-22 23:26:45 +01:00
parent 9dfb0642da
commit 7f1f5a8c3d
2 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,7 @@ import { NoteEditorProps } from '../utils/types';
const { buildStyle } = require('lib/theme');
export default function styles(props: NoteEditorProps) {
return buildStyle('NoteEditor', props.theme, (theme: any) => {
return buildStyle(['NoteEditor', props.style.width, props.style.height], props.theme, (theme: any) => {
return {
root: {
...props.style,

View File

@ -345,6 +345,8 @@ const cachedStyles_ = {
// the dependencies of the style change. If the style depends only
// on the theme, a static string can be provided as a cache key.
function buildStyle(cacheKey, themeId, callback) {
cacheKey = Array.isArray(cacheKey) ? cacheKey.join('_') : cacheKey;
// We clear the cache whenever switching themes
if (cachedStyles_.themeId !== themeId) {
cachedStyles_.themeId = themeId;