Skip to content

Commit

Permalink
feat(preview): Add currentFileVersionId in preview options (#2249)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingze authored Jul 22, 2020
1 parent 5df342d commit b527df8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/elements/content-preview/ContentPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ class ContentPreview extends React.PureComponent<Props, State> {

if (selectedVersion) {
setProp(fileOpts, [fileId, 'fileVersionId'], selectedVersion.id);
setProp(fileOpts, [fileId, 'currentFileVersionId'], getProp(file, 'file_version.id'));
}

if (activeAnnotationId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ describe('elements/content-preview/ContentPreview', () => {
test('should call preview show with file version params if provided', async () => {
const wrapper = getWrapper(props);
wrapper.setState({
file,
file: { ...file, file_version: { id: '67890' } },
selectedVersion: {
id: '12345',
},
Expand All @@ -323,6 +323,7 @@ describe('elements/content-preview/ContentPreview', () => {
fileOptions: {
[file.id]: {
fileVersionId: '12345',
currentFileVersionId: '67890',
},
},
}),
Expand Down

0 comments on commit b527df8

Please sign in to comment.