fix: mobx warnings and react render phase set state error
This commit is contained in:
@@ -80,12 +80,11 @@ export const TagsListItem: FunctionComponent<Props> = observer(
|
|||||||
const toggleChildren: MouseEventHandler = useCallback(
|
const toggleChildren: MouseEventHandler = useCallback(
|
||||||
(e) => {
|
(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
setShowChildren((x) => {
|
const shouldShowChildren = !showChildren
|
||||||
tagsState.setExpanded(tag, !x)
|
setShowChildren(shouldShowChildren)
|
||||||
return !x
|
tagsState.setExpanded(tag, !shouldShowChildren)
|
||||||
})
|
|
||||||
},
|
},
|
||||||
[setShowChildren, tag, tagsState],
|
[showChildren, tag, tagsState],
|
||||||
)
|
)
|
||||||
|
|
||||||
const selectCurrentTag = useCallback(async () => {
|
const selectCurrentTag = useCallback(async () => {
|
||||||
|
|||||||
@@ -214,6 +214,8 @@ export class ItemListController
|
|||||||
|
|
||||||
optionsSubtitle: computed,
|
optionsSubtitle: computed,
|
||||||
activeControllerItem: computed,
|
activeControllerItem: computed,
|
||||||
|
|
||||||
|
hydrateFromPersistedValue: action,
|
||||||
})
|
})
|
||||||
|
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ export class SelectedItemsController
|
|||||||
|
|
||||||
private replaceSelection = (item: ListableContentItem): void => {
|
private replaceSelection = (item: ListableContentItem): void => {
|
||||||
this.deselectAll()
|
this.deselectAll()
|
||||||
this.setSelectedUuids(this.selectedUuids.add(item.uuid))
|
runInAction(() => this.setSelectedUuids(this.selectedUuids.add(item.uuid)))
|
||||||
|
|
||||||
this.lastSelectedItem = item
|
this.lastSelectedItem = item
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user