mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Random fixes (#1276)
This commit is contained in:
parent
7f93317314
commit
0b6214be2b
@ -17,6 +17,7 @@ class HaMarkdown extends EventsMixin(PolymerElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
|
super.connectedCallback();
|
||||||
// 0 = not loaded, 1 = success, 2 = error
|
// 0 = not loaded, 1 = success, 2 = error
|
||||||
this._scriptLoaded = 0;
|
this._scriptLoaded = 0;
|
||||||
this._renderScheduled = false;
|
this._renderScheduled = false;
|
||||||
|
@ -226,7 +226,7 @@ class HomeAssistant extends LocalizeMixin(PolymerElement) {
|
|||||||
const host = window.location.protocol + '//' + window.location.host;
|
const host = window.location.protocol + '//' + window.location.host;
|
||||||
const auth = conn.options;
|
const auth = conn.options;
|
||||||
return hassCallApi(host, auth, method, path, parameters).catch((err) => {
|
return hassCallApi(host, auth, method, path, parameters).catch((err) => {
|
||||||
if (err.status_code !== 401 || !auth.accessToken) throw err;
|
if (!err || err.status_code !== 401 || !auth.accessToken) throw err;
|
||||||
|
|
||||||
// If we connect with access token and get 401, refresh token and try again
|
// If we connect with access token and get 401, refresh token and try again
|
||||||
return window.refreshToken().then((accessToken) => {
|
return window.refreshToken().then((accessToken) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user