fix: resolve runtime bugs (i18n export, chat crypto, async getUser, event leak) and remove dead code
This commit is contained in:
@@ -5,9 +5,10 @@ class PageSettings extends HTMLElement {
|
||||
constructor() {
|
||||
super()
|
||||
this.isLoggedIn = false
|
||||
this.user = null
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
async connectedCallback() {
|
||||
this.isLoggedIn = auth.isLoggedIn()
|
||||
|
||||
if (!this.isLoggedIn) {
|
||||
@@ -15,6 +16,7 @@ class PageSettings extends HTMLElement {
|
||||
return
|
||||
}
|
||||
|
||||
this.user = await auth.getUser()
|
||||
this.render()
|
||||
this.setupEventListeners()
|
||||
|
||||
@@ -137,7 +139,7 @@ class PageSettings extends HTMLElement {
|
||||
render() {
|
||||
const currentTheme = this.getCurrentTheme()
|
||||
const currentLang = i18n.getLocale()
|
||||
const user = auth.getUser()
|
||||
const user = this.user
|
||||
|
||||
this.innerHTML = /* html */`
|
||||
<div class="settings-page">
|
||||
|
||||
Reference in New Issue
Block a user