mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 13:27:22 +00:00
Fix showing sub info (#1785)
This commit is contained in:
parent
a6b4cce7f3
commit
af81ede100
@ -199,15 +199,23 @@ class HaConfigCloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
}
|
||||
|
||||
_formatSubscription(subInfo) {
|
||||
return subInfo === null
|
||||
? "Fetching subscription…"
|
||||
: subInfo.human_description.replace(
|
||||
"{periodEnd}",
|
||||
formatDateTime(
|
||||
new Date(subInfo.subscription.current_period_end * 1000),
|
||||
this.language
|
||||
)
|
||||
);
|
||||
if (subInfo === null) {
|
||||
return "Fetching subscription…";
|
||||
}
|
||||
|
||||
let description = subInfo.human_description;
|
||||
|
||||
if (subInfo.plan_renewal_date) {
|
||||
description = description.replace(
|
||||
"{periodEnd}",
|
||||
formatDateTime(
|
||||
new Date(subInfo.plan_renewal_date * 1000),
|
||||
this.language
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
_alexaChanged(ev) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user