Skip to content

Commit

Permalink
fix: dont close all edit dialogs on update/delete
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpyon committed Jan 17, 2021
1 parent 30d174d commit e18565d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/DialogDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const DialogDetails: FC<Props> = (props: Props) => {

dispatch(
dialogShowDeleteConfirm(asset._id, {
closeDialogId: id
closeDialogId: asset._id
})
)
}
Expand Down Expand Up @@ -208,7 +208,7 @@ const DialogDetails: FC<Props> = (props: Props) => {
},
// Options
{
closeDialogId: id
closeDialogId: asset._id
}
)
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {CloseIcon, Icon} from '@sanity/icons'
import {Box, Button, Flex, Inline, Text} from '@sanity/ui'
import {Box, Button, Flex} from '@sanity/ui'
import React, {FC} from 'react'

import useTypedSelector from '../../hooks/useTypedSelector'
Expand Down
3 changes: 1 addition & 2 deletions src/modules/dialog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function dialogReducer(
const {assetId} = action.payload
draft.items.push({
assetId,
id: 'details',
id: assetId,
type: 'details'
})
break
Expand Down Expand Up @@ -186,7 +186,6 @@ export const dialogClearOnAssetUpdateEpic = (
export const dialogTagCreateEpic = (action$: Observable<TagsActions>): Observable<DialogActions> =>
action$.pipe(
filter(isOfType(TagsActionTypes.CREATE_COMPLETE)),
// filter(action => !!action?.payload?.options?.closeDialogId),
mergeMap(action => {
const assetId = action?.payload?.options?.assetId

Expand Down

0 comments on commit e18565d

Please sign in to comment.