Skip to content

Commit

Permalink
Divide into two conditions in getMediaScalePreference
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkang112 committed Jun 22, 2021
1 parent 8b18a40 commit e1bf204
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/state/preferences/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,17 @@ export function getMediaScalePreference( state, key, isMobile ) {
null
);

if ( ( isMobile && mediaScale !== 1 ) || ( ! isMobile && mediaScale > SCALE_TOUCH_GRID ) ) {
// On mobile viewport, return the media scale value of 0.323 (3 columns per row)
// regardless of stored preference value, if it's not 1.
if ( isMobile && mediaScale !== 1 ) {
return SCALE_TOUCH_GRID;
}
// On non-mobile viewport, return the media scale value of 0.323 if the stored
// preference value is greater than 0.323.
if ( ! isMobile && mediaScale > SCALE_TOUCH_GRID ) {
return SCALE_TOUCH_GRID;
}

return mediaScale;
}
/**
Expand Down

0 comments on commit e1bf204

Please sign in to comment.