resourceloader: Also clear store in debug mode to simplify mw.loader.store.init()
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 25 Jul 2019 16:37:46 +0000 (17:37 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 25 Jul 2019 16:37:46 +0000 (17:37 +0100)
This makes it consistent with the other two circumstances in which
mw.loader.store is disabled.

Also, it makes debug=true a more easily accessible means for users
to clear module storage, which can be useful at times (without requiring
console access).

Change-Id: I9c66815a2f6c60feef3e070cfe57c382a69cc752

resources/src/startup/mediawiki.js

index dbb32e5..2081bfe 100644 (file)
                                                        /Firefox/.test( navigator.userAgent ) ||
 
                                                        // Disabled by configuration.
-                                                       !mw.config.get( 'wgResourceLoaderStorageEnabled' )
+                                                       !mw.config.get( 'wgResourceLoaderStorageEnabled' ) ||
+
+                                                       // Disable module store in debug mode context
+                                                       mw.config.get( 'debug' )
                                                ) {
                                                        // Clear any previous store to free up space. (T66721)
                                                        this.clear();
                                                        this.enabled = false;
                                                        return;
                                                }
-                                               if ( mw.config.get( 'debug' ) ) {
-                                                       // Disable module store in debug mode
-                                                       this.enabled = false;
-                                                       return;
-                                               }
 
                                                try {
                                                        // This a string we stored, or `null` if the key does not (yet) exist.