refactor: event delegation, unified subscription cleanup, centralized listing status helpers
This commit is contained in:
@@ -2,12 +2,14 @@ import { getCurrentLanguage, i18n } from '../../i18n.js'
|
||||
|
||||
class PageContact extends HTMLElement {
|
||||
connectedCallback() {
|
||||
this._unsubs = []
|
||||
this.render()
|
||||
this.unsubscribe = i18n.subscribe(() => this.render())
|
||||
this._unsubs.push(i18n.subscribe(() => this.render()))
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
if (this.unsubscribe) this.unsubscribe()
|
||||
this._unsubs.forEach(fn => fn())
|
||||
this._unsubs = []
|
||||
}
|
||||
|
||||
getContent(lang) {
|
||||
|
||||
Reference in New Issue
Block a user