Only send auth/current_user if new auth is enabled (#1483)

This commit is contained in:
Jason Hu 2018-07-20 03:02:30 -07:00 committed by Paulus Schoutsen
parent 9634a13dc2
commit abf85ae19b

View File

@ -333,9 +333,12 @@ class HomeAssistant extends LocalizeMixin(PolymerElement) {
);
});
this.hass.callWS({
type: 'auth/current_user',
}).then(user => this._updateHass({ user }), () => {});
// only for new auth
if (conn.options.accessToken) {
this.hass.callWS({
type: 'auth/current_user',
}).then(user => this._updateHass({ user }), () => {});
}
conn.subscribeEvents((event) => {
this._updateHass({ themes: event.data });