From 61b9024288db7e5b2176c010afcd3d72958093dc Mon Sep 17 00:00:00 2001 From: Afiq Nazrie Date: Wed, 6 Mar 2024 10:07:16 +0700 Subject: [PATCH] fix: check font.family of current iteration with current family Fix #56 --- app_src/components/modal/editStyle.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app_src/components/modal/editStyle.jsx b/app_src/components/modal/editStyle.jsx index 194ad84..f1c3259 100644 --- a/app_src/components/modal/editStyle.jsx +++ b/app_src/components/modal/editStyle.jsx @@ -257,7 +257,7 @@ const StyleDetails = React.memo(function StyleDetails(props) { }; const changeFontStyle = style => { - const font = fonts.find(font => (font.style === style)); + const font = fonts.find(font => ((font.family === family) && (font.style === style))); if (!font) return false; changeFont(font); }; @@ -506,4 +506,4 @@ StyleDetails.propTypes = { setTextProps: PropTypes.func.isRequired }; -export default EditStyleModal; \ No newline at end of file +export default EditStyleModal;