Skip to content

Commit

Permalink
Fixes issues with channel toggle (#6812)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Sep 7, 2020
1 parent e5c386c commit 0c7c536
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hassio/src/system/hassio-supervisor-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
setSupervisorOption,
SupervisorOptions,
updateSupervisor,
fetchHassioSupervisorInfo,
} from "../../../src/data/hassio/supervisor";
import {
showAlertDialog,
Expand Down Expand Up @@ -176,10 +177,11 @@ class HassioSupervisorInfo extends LitElement {

try {
const data: Partial<SupervisorOptions> = {
channel: this.supervisorInfo.channel !== "stable" ? "beta" : "stable",
channel: this.supervisorInfo.channel === "stable" ? "beta" : "stable",
};
await setSupervisorOption(this.hass, data);
await reloadSupervisor(this.hass);
this.supervisorInfo = await fetchHassioSupervisorInfo(this.hass);
} catch (err) {
showAlertDialog(this, {
title: "Failed to set supervisor option",
Expand All @@ -195,6 +197,7 @@ class HassioSupervisorInfo extends LitElement {

try {
await reloadSupervisor(this.hass);
this.supervisorInfo = await fetchHassioSupervisorInfo(this.hass);
} catch (err) {
showAlertDialog(this, {
title: "Failed to reload the supervisor",
Expand Down

0 comments on commit 0c7c536

Please sign in to comment.