Merge "Education popup: Put localStorage check inside try/catch"

This commit is contained in:
jenkins-bot 2016-09-20 21:44:53 +00:00 committed by Gerrit Code Review
commit f339754102

View file

@ -18,7 +18,12 @@ ve.ui.MWEducationPopupTool = function VeUiMwEducationPopupTool( config ) {
var popupCloseButton, $popupContent, $shield,
usePrefs = !mw.user.isAnon(),
prefSaysShow = usePrefs && !mw.user.options.get( 'visualeditor-hideusered' ),
tool = this;
tool = this,
localStorageHidePref = null;
try {
localStorageHidePref = localStorage.getItem( 've-hideusered' );
} catch ( e ) {}
config = config || {};
@ -29,7 +34,7 @@ ve.ui.MWEducationPopupTool = function VeUiMwEducationPopupTool( config ) {
!prefSaysShow &&
!(
!usePrefs &&
localStorage.getItem( 've-hideusered' ) === null &&
localStorageHidePref === null &&
$.cookie( 've-hideusered' ) === null
)
)