loginDialog: Realign list of batch tasks

The way the batch tasks are currently aligned doesn't jive with
with eslint likes.

This commit moves it over a bit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1809>
This commit is contained in:
Ray Strode 2021-04-14 09:31:40 -04:00
parent b93bf2bd69
commit 1410db2470

View File

@ -1048,54 +1048,56 @@ var LoginDialog = GObject.registerClass({
let loginItem = null; let loginItem = null;
let animationTime; let animationTime;
let tasks = [() => this._waitForItemForUser(userName), let tasks = [
() => this._waitForItemForUser(userName),
() => { () => {
loginItem = this._userList.getItemFromUserName(userName); loginItem = this._userList.getItemFromUserName(userName);
// If there is an animation running on the item, reset it. // If there is an animation running on the item, reset it.
loginItem.hideTimedLoginIndicator(); loginItem.hideTimedLoginIndicator();
}, },
() => { () => {
// If we're just starting out, start on the right item. // If we're just starting out, start on the right item.
if (!this._userManager.is_loaded) if (!this._userManager.is_loaded)
this._userList.jumpToItem(loginItem); this._userList.jumpToItem(loginItem);
}, },
() => { () => {
// This blocks the timed login animation until a few // This blocks the timed login animation until a few
// seconds after the user stops interacting with the // seconds after the user stops interacting with the
// login screen. // login screen.
// We skip this step if the timed login delay is very short. // We skip this step if the timed login delay is very short.
if (delay > _TIMED_LOGIN_IDLE_THRESHOLD) { if (delay > _TIMED_LOGIN_IDLE_THRESHOLD) {
animationTime = delay - _TIMED_LOGIN_IDLE_THRESHOLD; animationTime = delay - _TIMED_LOGIN_IDLE_THRESHOLD;
return this._blockTimedLoginUntilIdle(); return this._blockTimedLoginUntilIdle();
} else { } else {
animationTime = delay; animationTime = delay;
return null; return null;
} }
}, },
() => { () => {
// If idle timeout is done, make sure the timed login indicator is shown // If idle timeout is done, make sure the timed login indicator is shown
if (delay > _TIMED_LOGIN_IDLE_THRESHOLD && if (delay > _TIMED_LOGIN_IDLE_THRESHOLD &&
this._authPrompt.visible) this._authPrompt.visible)
this._authPrompt.cancel(); this._authPrompt.cancel();
if (delay > _TIMED_LOGIN_IDLE_THRESHOLD || firstRun) { if (delay > _TIMED_LOGIN_IDLE_THRESHOLD || firstRun) {
this._userList.scrollToItem(loginItem); this._userList.scrollToItem(loginItem);
loginItem.grab_key_focus(); loginItem.grab_key_focus();
} }
}, },
() => loginItem.showTimedLoginIndicator(animationTime), () => loginItem.showTimedLoginIndicator(animationTime),
() => { () => {
this._timedLoginBatch = null; this._timedLoginBatch = null;
this._greeter.call_begin_auto_login_sync(userName, null); this._greeter.call_begin_auto_login_sync(userName, null);
}]; },
];
this._timedLoginBatch = new Batch.ConsecutiveBatch(this, tasks); this._timedLoginBatch = new Batch.ConsecutiveBatch(this, tasks);