Fix unit and currency, always select first result of search (#17753)

* Fix unit and currency, always select first result of search

* Update onboarding-location.ts
This commit is contained in:
Bram Kragten 2023-08-31 14:23:33 +02:00 committed by GitHub
parent f3ed0160af
commit 93846a2867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -32,10 +32,6 @@ class OnboardingCoreConfig extends LitElement {
private _elevation = "0";
private _unitSystem: ConfigUpdateValues["unit_system"] = "metric";
private _currency: ConfigUpdateValues["currency"] = "EUR";
private _timeZone: ConfigUpdateValues["time_zone"] =
Intl.DateTimeFormat?.().resolvedOptions?.().timeZone;
@ -43,6 +39,10 @@ class OnboardingCoreConfig extends LitElement {
@state() private _country?: ConfigUpdateValues["country"];
private _unitSystem?: ConfigUpdateValues["unit_system"];
private _currency?: ConfigUpdateValues["currency"];
@state() private _error?: string;
@state() private _skipCore = false;

View File

@ -336,7 +336,7 @@ class OnboardingLocation extends LitElement {
);
try {
this._places = await searchPlaces(address, this.hass, true, 3);
if (this._places?.length === 1) {
if (this._places?.length) {
this._highlightedMarker = this._places[0].place_id;
this._location = [
Number(this._places[0].lat),