From 4e2f6b1d26052445010404da80cc72e7464ca68e Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Mon, 5 Dec 2022 22:39:38 -0600 Subject: [PATCH] move callIfExists to base file scope --- .../editor/metadataEditor/metadataEditor.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx index 973ab3da0..b9e702c83 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx +++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx @@ -15,6 +15,12 @@ const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder']; const homebreweryThumbnail = require('../../thumbnail.png'); +const callIfExists = (val, fn, ...args)=>{ + if(val[fn]) { + val[fn](...args); + } +}; + const MetadataEditor = createClass({ displayName : 'MetadataEditor', getDefaultProps : function() { @@ -53,12 +59,6 @@ const MetadataEditor = createClass({ }, handleFieldChange : function(name, e){ - const callIfExists = (val, fn, ...args)=>{ - if(val[fn]) { - val[fn](...args); - } - }; - callIfExists(e, 'persist'); // load validation rules, and check input value against them