Skip to content

Commit 2d0f53a

Browse files
jellymartinpitt
authored andcommitted
lib: drop cockpit promise wrapper in install dialog
Now that this code no longer calls `notify()` the wrapper is unrequired.
1 parent 95e65b8 commit 2d0f53a

1 file changed

Lines changed: 17 additions & 27 deletions

File tree

pkg/lib/cockpit-components-install-dialog.jsx

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -174,33 +174,23 @@ export function install_dialog(pkg, options) {
174174
}
175175

176176
function install_missing(progress_cb) {
177-
const dfd = cockpit.defer();
178-
179-
PK.install_missing_packages(data,
180-
p => {
181-
let text = null;
182-
if (p.waiting) {
183-
text = _("Waiting for other software management operations to finish");
184-
} else if (p.package) {
185-
let fmt;
186-
if (p.info == PK.Enum.INFO_DOWNLOADING)
187-
fmt = _("Downloading $0");
188-
else if (p.info == PK.Enum.INFO_REMOVING)
189-
fmt = _("Removing $0");
190-
else
191-
fmt = _("Installing $0");
192-
text = format_to_fragments(fmt, <strong>{p.package}</strong>);
193-
}
194-
progress_cb(text, p.cancel);
195-
})
196-
.then(() => {
197-
dfd.resolve();
198-
})
199-
.catch(error => {
200-
dfd.reject(error);
201-
});
202-
203-
return dfd.promise;
177+
return PK.install_missing_packages(data,
178+
p => {
179+
let text = null;
180+
if (p.waiting) {
181+
text = _("Waiting for other software management operations to finish");
182+
} else if (p.package) {
183+
let fmt;
184+
if (p.info == PK.Enum.INFO_DOWNLOADING)
185+
fmt = _("Downloading $0");
186+
else if (p.info == PK.Enum.INFO_REMOVING)
187+
fmt = _("Removing $0");
188+
else
189+
fmt = _("Installing $0");
190+
text = format_to_fragments(fmt, <strong>{p.package}</strong>);
191+
}
192+
progress_cb(text, p.cancel);
193+
});
204194
}
205195

206196
update();

0 commit comments

Comments
 (0)