File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/javascript/Components/Result Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ export class TextViewer extends React.PureComponent {
106106 if ( content && ( content !== prevContent || this . props . annotations !== prevProps . annotations ) ) {
107107 this . ready_annotations ( ) ;
108108 this . setState ( { copy_success : false } ) ;
109+
110+ if ( localStorage . getItem ( "text_viewer_font_size" ) != null ) {
111+ this . setState ( { font_size : Number ( localStorage . getItem ( "text_viewer_font_size" ) ) } ) ;
112+ }
109113 } else if ( this . props . focusLine !== prevProps . focusLine ) {
110114 this . scrollToLine ( this . props . focusLine ) ;
111115 }
@@ -178,7 +182,9 @@ export class TextViewer extends React.PureComponent {
178182 } ;
179183
180184 change_font_size = delta => {
181- this . setState ( { font_size : Math . max ( this . state . font_size + delta , 0.25 ) } ) ;
185+ let font_size = Math . max ( this . state . font_size + delta , 0.25 ) ;
186+ this . setState ( { font_size : font_size } ) ;
187+ localStorage . setItem ( "text_viewer_font_size" , font_size ) ;
182188 } ;
183189
184190 display_annotation = annotation => {
You can’t perform that action at this time.
0 commit comments