Skip to content

Commit

Permalink
revert test restart screen after config update
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Nov 10, 2023
1 parent 27c3fd3 commit f5e82ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ <h5 class="modal-title">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div *ngIf="actionComplete" class="modal-body">
<!-- blank for now -->
</div>
<div *ngIf="!actionComplete" class="modal-body">
<div class="modal-body">
<div>
<markdown class="plugin-md" [data]="schema.headerDisplay | interpolateMd"
*ngIf="schema.headerDisplay"></markdown>
Expand Down Expand Up @@ -58,7 +55,7 @@ <h5 class="m-0">{{ block.name }}</h5>
*ngIf="schema.footerDisplay"></markdown>
</div>
</div>
<div *ngIf="!actionComplete" class="modal-footer justify-content-between">
<div class="modal-footer justify-content-between">
<div style="min-width: 25%;" class="text-left">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.close('Cross click')"
[translate]="'form.button_cancel'">Cancel</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class SettingsPluginsModalComponent implements OnInit {
public pluginAlias: string;
public pluginType: 'platform' | 'accessory';

public actionComplete = false;
public pluginConfig: PluginConfigBlock[] = [];
public form: any = {};
public show = '';
Expand Down Expand Up @@ -86,28 +85,21 @@ export class SettingsPluginsModalComponent implements OnInit {
try {
await this.$api.post(`/config-editor/plugin/${encodeURIComponent(this.plugin.name)}`, configBlocks)
.toPromise();
this.$toastr.success(
this.translate.instant('plugins.settings.toast_restart_required'),
this.translate.instant('plugins.settings.toast_plugin_config_saved'));

this.activeModal.close(configBlocks.length ? this.schema : null);
this.$notification.configUpdated.next(undefined);

// reload app settings if the config was changed for Homebridge UI
if (this.plugin.name === 'homebridge-config-ui-x') {
this.$settings.getAppSettings().catch();
}

this.actionComplete = true;

// this.$toastr.success(
// this.translate.instant('plugins.settings.toast_restart_required'),
// this.translate.instant('plugins.settings.toast_plugin_config_saved'),
// );
// this.activeModal.close(configBlocks.length ? this.schema : null);
// this.$notification.configUpdated.next(undefined);


} catch (err) {
this.$toastr.error(
this.translate.instant(
'config.toast_failed_to_save_config') + ': ' + err.error?.message,
this.translate.instant('toast.title_error'),
);
this.translate.instant('config.toast_failed_to_save_config') + ': ' + err.error?.message,
this.translate.instant('toast.title_error'));
} finally {
this.saveInProgress = false;
}
Expand Down

0 comments on commit f5e82ae

Please sign in to comment.