Fix one more place where we tried to set preferences for temp users

Follow-up to 3b1a2d9dce.

Bug: T332415
Bug: T332435
Change-Id: I1139f1f3421fe43dfd5e3125b18d40421930a0f1
This commit is contained in:
Bartosz Dziewoński 2023-05-10 04:20:03 +02:00
parent 3a0ec4a808
commit ec425a06af

View file

@ -1133,7 +1133,7 @@ class Hooks implements DifferenceEngineBeforeDiffTableHook {
*/
public static function onUserLoggedIn( $user ) {
$cookie = RequestContext::getMain()->getRequest()->getCookie( 'VEE', '' );
if ( $cookie === 'visualeditor' || $cookie === 'wikitext' ) {
if ( $user->isNamed() && ( $cookie === 'visualeditor' || $cookie === 'wikitext' ) ) {
self::deferredSetUserOption( $user, 'visualeditor-editor', $cookie );
}
}