mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Prefer localStorage to store ve-beta-welcome-dialog
Bug: 62884 Change-Id: I3fe45e890c29aaa8d28edfb6986dc8c7541861c7
This commit is contained in:
parent
8a1adef97c
commit
51b091b9cd
|
@ -1657,7 +1657,11 @@ ve.init.mw.ViewPageTarget.prototype.maybeShowDialogs = function () {
|
|||
!urlSaysHide &&
|
||||
(
|
||||
prefSaysShow ||
|
||||
( !usePrefs && $.cookie( 've-beta-welcome-dialog' ) === null )
|
||||
(
|
||||
!usePrefs &&
|
||||
localStorage.getItem( 've-beta-welcome-dialog' ) === null &&
|
||||
$.cookie( 've-beta-welcome-dialog' ) === null
|
||||
)
|
||||
)
|
||||
) {
|
||||
this.surface.getDialogs().openWindow( 'betaWelcome' );
|
||||
|
@ -1674,7 +1678,11 @@ ve.init.mw.ViewPageTarget.prototype.maybeShowDialogs = function () {
|
|||
// set the hidebetawelcome=1 preference, but only if this isn't a one-off
|
||||
// view of the page via the hiding GET parameter.
|
||||
} else if ( !usePrefs && !urlSaysHide ) {
|
||||
$.cookie( 've-beta-welcome-dialog', 1, { path: '/', expires: 30 } );
|
||||
try {
|
||||
localStorage.setItem( 've-beta-welcome-dialog', 1 );
|
||||
} catch ( e ) {
|
||||
$.cookie( 've-beta-welcome-dialog', 1, { path: '/', expires: 30 } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue