Fixes lightbox selectedIndex
This commit is contained in:
@@ -21,12 +21,17 @@ export const getIsViewOnce = createSelector(
|
|||||||
|
|
||||||
export const getSelectedIndex = createSelector(
|
export const getSelectedIndex = createSelector(
|
||||||
getLightboxState,
|
getLightboxState,
|
||||||
(state): number =>
|
(state): number => {
|
||||||
state.isShowingLightbox
|
if (!state.isShowingLightbox) {
|
||||||
? state.media.findIndex(
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const index = state.media.findIndex(
|
||||||
item => item.attachment.path === state.selectedAttachmentPath
|
item => item.attachment.path === state.selectedAttachmentPath
|
||||||
) || 0
|
);
|
||||||
: 0
|
|
||||||
|
return index > 0 ? index : 0;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMedia = createSelector(
|
export const getMedia = createSelector(
|
||||||
|
Reference in New Issue
Block a user