Support duplicate attachments in lightbox

This commit is contained in:
Fedor Indutny 2023-09-26 17:38:21 +02:00 committed by GitHub
parent b885ced90d
commit 1a2976dae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 45 deletions

View file

@ -27,11 +27,7 @@ export const getSelectedIndex = createSelector(
return 0;
}
const index = state.media.findIndex(
item => item.attachment.path === state.selectedAttachmentPath
);
return index > 0 ? index : 0;
return state.selectedIndex ?? 0;
}
);