Skip to content

Commit

Permalink
Merge pull request #223 from huridocs/221
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
txau authored Jul 26, 2016
2 parents ae47e83 + 91e64e3 commit d521582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/react/Viewer/components/SourceDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {setSelection} from 'app/Viewer/actions/selectionActions';
import {resetReferenceCreation, highlightReference, activateReference} from 'app/Viewer/actions/uiActions';
import Document from 'app/Viewer/components/Document';

const mapStateToProps = ({documentViewer}) => {
const mapStateToProps = ({user, documentViewer}) => {
let uiState = documentViewer.uiState.toJS();
return {
selection: uiState.reference.sourceRange,
Expand All @@ -16,7 +16,7 @@ const mapStateToProps = ({documentViewer}) => {
highlightedReference: uiState.highlightedReference,
activeReference: uiState.activeReference,
executeOnClickHandler: !!documentViewer.targetDoc.get('_id'),
disableTextSelection: documentViewer.uiState.get('panel') === 'viewMetadataPanel'
disableTextSelection: !user.get('_id') || documentViewer.uiState.get('panel') === 'viewMetadataPanel'
|| documentViewer.uiState.get('panel') === 'viewReferencesPanel',
forceSimulateSelection: documentViewer.uiState.get('panel') === 'targetReferencePanel'
|| documentViewer.uiState.get('panel') === 'referencePanel'
Expand Down
1 change: 1 addition & 0 deletions app/react/Viewer/components/specs/SourceDocument.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('SourceDocument', function () {
const mockStore = configureMockStore([]);

let state = {
user: Immutable.fromJS({_id: 1}),
documentViewer: {
uiState: Immutable.fromJS({
reference: {sourceRange: {selection: 'selection'}},
Expand Down

0 comments on commit d521582

Please sign in to comment.