@@ -118,14 +118,14 @@ export default class HighlightColorPicker extends React.Component<
118
118
}
119
119
120
120
componentWillUnmount ( ) : void {
121
- if ( this . state . highlightColorStateChanged ) {
122
- this . saveHighlightColorSettings ( )
123
- }
121
+ // if (this.state.highlightColorStateChanged) {
122
+ // this.saveHighlightColorSettings()
123
+ // }
124
124
}
125
125
126
- getHighlightColorSettings = async ( ) => {
126
+ getHighlightColorSettings = async ( forceUpdate ? ) => {
127
127
let highlightColors = this . state . highlightColorSettingState
128
- if ( ! highlightColors ) {
128
+ if ( ! highlightColors || forceUpdate ) {
129
129
highlightColors = await this . syncSettings . highlightColors . get (
130
130
'highlightColors' ,
131
131
)
@@ -176,6 +176,9 @@ export default class HighlightColorPicker extends React.Component<
176
176
modifyDomHighlightColor ( highlight , colorItem )
177
177
}
178
178
}
179
+ this . setState ( {
180
+ highlightColorSettingState : this . state . highlightColorSettingState ,
181
+ } )
179
182
180
183
await this . syncSettings . highlightColors . set (
181
184
'highlightColors' ,
@@ -195,11 +198,12 @@ export default class HighlightColorPicker extends React.Component<
195
198
onClick = { ( event ) => {
196
199
event . stopPropagation ( )
197
200
} }
201
+ key = { 'ColorEditBox' + index }
198
202
>
199
203
< TopBarBox >
200
204
< PrimaryAction
201
205
label = { 'Cancel' }
202
- onClick = { ( event ) => {
206
+ onClick = { async ( event ) => {
203
207
let highlights : NodeListOf < Element > = document . querySelectorAll (
204
208
'.' + DEF_HIGHLIGHT_CSS_CLASS ,
205
209
)
@@ -225,11 +229,10 @@ export default class HighlightColorPicker extends React.Component<
225
229
const newShowEditColor = [
226
230
...this . state . showEditColor ,
227
231
]
232
+
233
+ this . getHighlightColorSettings ( true )
228
234
newShowEditColor [ index ] = false
229
235
this . setState ( {
230
- highlightColorSettingState : [
231
- ...this . state . highlightColorSettingState ,
232
- ] ,
233
236
showColorEditorPanel : false ,
234
237
showEditColor : newShowEditColor ,
235
238
} )
@@ -465,6 +468,7 @@ export default class HighlightColorPicker extends React.Component<
465
468
} }
466
469
active = { this . state . showEditColor [ i ] }
467
470
selected = { this . state . selectedRow === i }
471
+ key = { colorId }
468
472
>
469
473
< ColorPickerCircle
470
474
backgroundColor = { RGBAobjectToString (
0 commit comments