loginManager: Return objects instead of multiple booleans

Multiple booleans - both in arguments and return values - are almost
always problematic API, because people have to memorize (or more likely
look up) the meaning of each position.

Instead, return a JS object so each value has a name attached to it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2370>
This commit is contained in:
Florian Müllner
2022-07-08 16:23:39 +02:00
parent 637ee7386e
commit 0c68c33826
3 changed files with 24 additions and 12 deletions

View File

@ -305,7 +305,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
}
async _getCanRebootToBootLoaderMenu() {
const [canRebootToBootLoaderMenu] = await this._loginManager.canRebootToBootLoaderMenu();
const {canRebootToBootLoaderMenu} = await this._loginManager.canRebootToBootLoaderMenu();
this._canRebootToBootLoaderMenu = canRebootToBootLoaderMenu;
}