diff --git a/frontend/src/shared-file-view-text.js b/frontend/src/shared-file-view-text.js index 6692ffd9e7..8ff27624a0 100644 --- a/frontend/src/shared-file-view-text.js +++ b/frontend/src/shared-file-view-text.js @@ -20,10 +20,11 @@ const FileContent = ({ lineWrapping }) => { }; const SharedFileViewText = () => { - let [lineWrapping, setLineWrapping] = useState(localStorage.getItem('sf_txt_file_line_wrapping') === 'true' || true); + let [lineWrapping, setLineWrapping] = useState(localStorage.getItem('sf_txt_file_line_wrapping') !== 'false'); const updateLineWrapping = (newLineWrapping) => { setLineWrapping(newLineWrapping); + localStorage.setItem('sf_txt_file_line_wrapping', newLineWrapping); }; return ( diff --git a/frontend/src/view-file-text.js b/frontend/src/view-file-text.js index c71049f963..5e7ca2eaac 100644 --- a/frontend/src/view-file-text.js +++ b/frontend/src/view-file-text.js @@ -49,7 +49,7 @@ class ViewFileText extends React.Component { needSave: false, isSaving: false, participants: [], - lineWrapping: localStorage.getItem('sf_txt_file_line_wrapping') === 'true' || true, + lineWrapping: localStorage.getItem('sf_txt_file_line_wrapping') !== 'false', }; this.onSave = this.onSave.bind(this); this.isParticipant = false;