fix: add fallback date formatting for cases when IntlUtil is not available

This commit is contained in:
lolka1333 2025-12-14 12:02:01 +01:00
parent 527e1b2c75
commit 1d732606f3

View file

@ -1458,7 +1458,12 @@
formatLastOnline(email) { formatLastOnline(email) {
const ts = this.getLastOnline(email) const ts = this.getLastOnline(email)
if (!ts) return '-' if (!ts) return '-'
// Check if IntlUtil is available (may not be loaded yet)
if (typeof IntlUtil !== 'undefined' && IntlUtil.formatDate) {
return IntlUtil.formatDate(ts) return IntlUtil.formatDate(ts)
}
// Fallback to simple date formatting if IntlUtil is not available
return new Date(ts).toLocaleString()
}, },
isRemovable(dbInboundId) { isRemovable(dbInboundId) {
return this.getInboundClients(this.dbInbounds.find(row => row.id === dbInboundId)).length > 1; return this.getInboundClients(this.dbInbounds.find(row => row.id === dbInboundId)).length > 1;