File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,25 @@ export default function Servers() {
6262 } , [ ] )
6363
6464 useEffect ( ( ) => {
65- const inlineState = localStorage . getItem ( "inline" )
66- if ( window . ForceCardInline ) {
67- setInline ( "1" )
68- } else if ( inlineState !== null ) {
69- setInline ( inlineState )
65+ const checkInlineSettings = ( ) => {
66+ const isMobile = window . innerWidth < 768
67+
68+ if ( ! isMobile ) {
69+ const inlineState = localStorage . getItem ( "inline" )
70+ if ( window . ForceCardInline ) {
71+ setInline ( "1" )
72+ } else if ( inlineState !== null ) {
73+ setInline ( inlineState )
74+ }
75+ }
76+ }
77+
78+ checkInlineSettings ( )
79+
80+ window . addEventListener ( "resize" , checkInlineSettings )
81+
82+ return ( ) => {
83+ window . removeEventListener ( "resize" , checkInlineSettings )
7084 }
7185 } , [ ] )
7286
You can’t perform that action at this time.
0 commit comments