mirror of
https://github.com/haiwen/seahub.git
synced 2025-10-21 10:51:17 +00:00
fix shared txt file line wrap
This commit is contained in:
@@ -19,10 +19,11 @@ const FileContent = ({ lineWrapping }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const SharedFileViewText = () => {
|
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) => {
|
const updateLineWrapping = (newLineWrapping) => {
|
||||||
setLineWrapping(newLineWrapping);
|
setLineWrapping(newLineWrapping);
|
||||||
|
localStorage.setItem('sf_txt_file_line_wrapping', newLineWrapping);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@@ -49,7 +49,7 @@ class ViewFileText extends React.Component {
|
|||||||
needSave: false,
|
needSave: false,
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
participants: [],
|
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.onSave = this.onSave.bind(this);
|
||||||
this.isParticipant = false;
|
this.isParticipant = false;
|
||||||
|
Reference in New Issue
Block a user