Skip to content

Commit

Permalink
N°7707 - Newsroom user preference display counter not changeable
Browse files Browse the repository at this point in the history
  • Loading branch information
xguiboud committed Nov 14, 2024
1 parent 31d4297 commit f7c0ae1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ function GetToastsPositionFieldBlock(): iUIBlock
if ($iNewsroomDisplaySize > 20) {
$iNewsroomDisplaySize = 20;
}
$iCurrentDisplaySize = (int)appUserPreferences::GetPref('newsroom_display_size', $iNewsroomDisplaySize);
$iCurrentDisplaySize = (int)appUserPreferences::GetPref('newsroom_display_size', 7);

This comment has been minimized.

Copy link
@rquetiez

rquetiez Nov 22, 2024

Contributor

Please, use a constant instead.
Also take the opportunity to introduce a constant on the limit (20), or any other related value.

if ($iCurrentDisplaySize != $iNewsroomDisplaySize) {
// Save the preference only if it differs from the current (or default) value
appUserPreferences::SetPref('newsroom_display_size', $iNewsroomDisplaySize);
Expand Down

0 comments on commit f7c0ae1

Please sign in to comment.