RCFilters: Hide 'reload watchlist automatically' setting if RCFilters is enabled
authorMoriel Schottlender <moriel@gmail.com>
Mon, 26 Mar 2018 08:04:40 +0000 (11:04 +0300)
committerMoriel Schottlender <moriel@gmail.com>
Mon, 26 Mar 2018 15:30:37 +0000 (18:30 +0300)
Bug: T186277
Change-Id: I78a2bae5f8d0e6f947276c69fa1806eeaad46197

includes/preferences/DefaultPreferencesFactory.php

index 478f373..b2b68d2 100644 (file)
@@ -1117,11 +1117,18 @@ class DefaultPreferencesFactory implements PreferencesFactory {
                        'section' => 'watchlist/advancedwatchlist',
                        'label-message' => 'tog-watchlisthideliu',
                ];
-               $defaultPreferences['watchlistreloadautomatically'] = [
-                       'type' => 'toggle',
-                       'section' => 'watchlist/advancedwatchlist',
-                       'label-message' => 'tog-watchlistreloadautomatically',
-               ];
+
+               if ( !\SpecialWatchlist::checkStructuredFilterUiEnabled(
+                       $this->config,
+                       $user
+               ) ) {
+                       $defaultPreferences['watchlistreloadautomatically'] = [
+                               'type' => 'toggle',
+                               'section' => 'watchlist/advancedwatchlist',
+                               'label-message' => 'tog-watchlistreloadautomatically',
+                       ];
+               }
+
                $defaultPreferences['watchlistunwatchlinks'] = [
                        'type' => 'toggle',
                        'section' => 'watchlist/advancedwatchlist',