[gnome-shell] endSessionDialog: Small cleanup
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] endSessionDialog: Small cleanup
- Date: Mon, 11 Jul 2022 14:19:00 +0000 (UTC)
commit 97b20792579ee4dee3a04e75f46d5cfff0970cf8
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jul 8 21:36:07 2022 +0200
endSessionDialog: Small cleanup
Array.prototype.push() returns the new number of elements, so
no need to track the number separately.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2369>
js/ui/endSessionDialog.js | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index b0f71f5cff..dddfd51f06 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -647,7 +647,6 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
_loadSessions() {
this._loginManager.listSessions(result => {
- let n = 0;
for (let i = 0; i < result.length; i++) {
let [id_, uid_, userName, seat_, sessionPath] = result[i];
let proxy = new LogindSession(Gio.DBus.system, 'org.freedesktop.login1', sessionPath);
@@ -675,7 +674,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
type: proxy.Type,
remote: proxy.Remote,
};
- this._sessions.push(session);
+ const nSessions = this._sessions.push(session);
let userAvatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE });
userAvatar.update();
@@ -699,8 +698,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._sessionSection.list.add_child(listItem);
// limit the number of entries
- n++;
- if (n == MAX_USERS_IN_SESSION_DIALOG)
+ if (nSessions === MAX_USERS_IN_SESSION_DIALOG)
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]