cleanup: Use optional chaining and ?? operator
Those operators have been supported since gjs switched to mozjs78 last cycle. While not ground-breaking, using it makes for a nice cleanup here and there. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1517>
This commit is contained in:

committed by
Marge Bot

parent
c9df2f9370
commit
40e22eb524
@ -176,7 +176,7 @@ var AutomountManager = class {
|
||||
if (allowAutorun)
|
||||
this._allowAutorun(volume);
|
||||
|
||||
let mountOp = operation ? operation.mountOp : null;
|
||||
const mountOp = operation?.mountOp ?? null;
|
||||
this._activeOperations.set(volume, operation);
|
||||
|
||||
volume.mount(0, mountOp, null,
|
||||
@ -226,7 +226,7 @@ var AutomountManager = class {
|
||||
|
||||
_reaskPassword(volume) {
|
||||
let prevOperation = this._activeOperations.get(volume);
|
||||
let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
|
||||
const existingDialog = prevOperation?.borrowDialog();
|
||||
let operation =
|
||||
new ShellMountOperation.ShellMountOperation(volume,
|
||||
{ existingDialog });
|
||||
|
Reference in New Issue
Block a user