mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Refresh labels on the article when edited in the library
This commit is contained in:
parent
0203347c4a
commit
99cab91d40
1 changed files with 8 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ import { usePersistedState } from '../../../lib/hooks/usePersistedState'
|
|||
import { showErrorToast, showSuccessToast } from '../../../lib/toastHelpers'
|
||||
import { ConfirmationModal } from '../../patterns/ConfirmationModal'
|
||||
import { SetLabelsModal } from '../article/SetLabelsModal'
|
||||
import { Label } from '../../../lib/networking/fragments/labelFragment'
|
||||
|
||||
export type LayoutType = 'LIST_LAYOUT' | 'GRID_LAYOUT'
|
||||
|
||||
|
|
@ -726,8 +727,13 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element {
|
|||
<SetLabelsModal
|
||||
linkId={props.labelsTarget.node.id}
|
||||
labels={props.labelsTarget.node.labels}
|
||||
articleActionHandler={() => {
|
||||
|
||||
articleActionHandler={(action, value) => {
|
||||
switch(action) {
|
||||
case 'refreshLabels':
|
||||
if (props.labelsTarget) {
|
||||
props.labelsTarget.node.labels = value as (Label[] | undefined)
|
||||
}
|
||||
}
|
||||
}}
|
||||
onOpenChange={() => {
|
||||
props.setLabelsTarget(undefined)
|
||||
|
|
|
|||
Loading…
Reference in a new issue