Skip to content

Commit

Permalink
Update manage-plugins-modal.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Nov 10, 2023
1 parent 9207332 commit 5e78543
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
this.$toastr.success(`${this.pastTenseVerb} ${this.pluginName}`, this.toastSuccess);
this.getChangeLog();
this.getChildBridges();
this.$notification.configUpdated.next(undefined);
},
(err) => {
this.actionFailed = true;
Expand Down Expand Up @@ -250,18 +249,22 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
}

public async onRestartChildBridgeClick() {
const io = this.$ws.connectToNamespace('child-bridges');
try {
for (const bridge of this.childBridges) {
await io.request('restart-child-bridge', bridge.username).toPromise();
await this.$api.put(`/server/restart/${bridge.username}`, {}).toPromise();
}

// toast success
this.$toastr.success(
'SUCCESS!!!',
this.$translate.instant('toast.title_success'),
);
} catch (err) {
this.$toastr.error(
'Failed to restart child bridge: ' + err.error?.message,
'Error restarting child bridge, please restart Homebridge instead.',
this.$translate.instant('toast.title_error'),
);
} finally {
io.end();
this.activeModal.close();
}
}
Expand Down

0 comments on commit 5e78543

Please sign in to comment.