@@ -90,12 +90,11 @@ const ColorSchemePicker = props => {
9090 } = props
9191
9292 const {
93- colorSchemes, cachedCss ,
93+ colorSchemes,
9494 } = useSelect ( select => {
95- const { colorSchemes : _colorSchemes , cachedCss } = select ( 'stackable/global-color-schemes' ) . getSettings ( )
95+ const { colorSchemes : _colorSchemes } = select ( 'stackable/global-color-schemes' ) . getSettings ( )
9696 return {
9797 colorSchemes : cloneDeep ( _colorSchemes ) ,
98- cachedCss,
9998 }
10099 } )
101100
@@ -128,7 +127,7 @@ const ColorSchemePicker = props => {
128127
129128 // Add a custom color scheme
130129 const handleAddItem = ( event , scheme = null ) => {
131- doAction ( 'stackable.global-settings.global-color-schemes.custom-color-schemes.add-color-scheme' , scheme , setItemInEdit , cachedCss , saveTimeout )
130+ doAction ( 'stackable.global-settings.global-color-schemes.custom-color-schemes.add-color-scheme' , scheme , setItemInEdit , saveTimeout )
132131 }
133132
134133 // For sorting custom color schemes
@@ -140,7 +139,7 @@ const ColorSchemePicker = props => {
140139 clearTimeout ( saveTimeout )
141140
142141 // If the color scheme being edited is a custom color scheme, customUpdate will return true
143- const customUpdate = applyFilters ( 'stackable.global-settings.global-color-schemes.update-color-schemes' , false , currentItem , cachedCss , saveTimeout )
142+ const customUpdate = applyFilters ( 'stackable.global-settings.global-color-schemes.update-color-schemes' , false , currentItem , saveTimeout )
144143
145144 if ( ! customUpdate ) {
146145 // Do this only when the color scheme being edited is the default/fixed color schemes (the first two color schemes)
@@ -152,14 +151,13 @@ const ColorSchemePicker = props => {
152151 const settings = new models . Settings ( {
153152 stackable_global_color_schemes : updatedColorSchemes , // eslint-disable-line camelcase
154153 // Clear the cached CSS when the color scheme is updated
155- ... ( cachedCss ? { stackable_global_color_scheme_generated_css : '' } : { } ) , // eslint-disable-line camelcase
154+ stackable_global_color_scheme_generated_css : '' , // eslint-disable-line camelcase
156155 } )
157156 settings . save ( )
158157 } , 300 )
159158
160159 // Update our store.
161160 dispatch ( 'stackable/global-color-schemes' ) . updateColorSchemes ( updatedColorSchemes )
162- dispatch ( 'stackable/global-color-schemes' ) . updateSettings ( { cachedCss : '' } )
163161 }
164162 }
165163
@@ -263,7 +261,7 @@ const ColorSchemePicker = props => {
263261
264262 const onDeleteItem = item => {
265263 // If the color scheme to be deleted is a custom color scheme, customDelete will return true
266- const customDelete = applyFilters ( 'stackable.global-settings.global-color-schemes.delete-color-scheme' , false , item , setItemInEdit , cachedCss , saveTimeout )
264+ const customDelete = applyFilters ( 'stackable.global-settings.global-color-schemes.delete-color-scheme' , false , item , setItemInEdit , saveTimeout )
267265
268266 if ( ! customDelete ) {
269267 // Do not delete if it is not a custom color scheme, reset it to the default value instead.
@@ -330,7 +328,7 @@ const ColorSchemePicker = props => {
330328 // 2. Heading Color, Text Color, Accent Color when it is in the hover state
331329 if ( property === 'backgroundColor' ) {
332330 if ( isGradient ( itemInEdit ?. colorScheme [ property ] ?. desktop ) && currentHoverState !== 'normal' ) {
333- return false
331+ return true
334332 }
335333
336334 return currentHoverState === 'parent-hover'
0 commit comments