1
0
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:
Michael An
2025-10-10 16:11:58 +08:00
parent af919ebeb5
commit 85e7455092
2 changed files with 3 additions and 2 deletions

View File

@@ -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 (

View File

@@ -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;