chore: app group optimizations (#1027)
This commit is contained in:
@@ -62,6 +62,7 @@ export class IOService {
|
||||
if (!modifier) {
|
||||
return
|
||||
}
|
||||
|
||||
switch (modifier) {
|
||||
case KeyboardModifier.Meta: {
|
||||
if (this.isMac) {
|
||||
@@ -197,8 +198,10 @@ export class IOService {
|
||||
|
||||
addKeyObserver(observer: KeyboardObserver): () => void {
|
||||
this.observers.push(observer)
|
||||
|
||||
const thislessObservers = this.observers
|
||||
return () => {
|
||||
removeFromArray(this.observers, observer)
|
||||
removeFromArray(thislessObservers, observer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ export class ThemeManager extends ApplicationService {
|
||||
|
||||
override async onAppEvent(event: ApplicationEvent) {
|
||||
super.onAppEvent(event).catch(console.error)
|
||||
|
||||
switch (event) {
|
||||
case ApplicationEvent.SignedOut: {
|
||||
this.deactivateAllThemes()
|
||||
@@ -91,6 +92,7 @@ export class ThemeManager extends ApplicationService {
|
||||
;(this.unregisterStream as unknown) = undefined
|
||||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').removeEventListener('change', this.colorSchemeEventHandler)
|
||||
|
||||
super.deinit()
|
||||
}
|
||||
|
||||
@@ -226,6 +228,7 @@ export class ThemeManager extends ApplicationService {
|
||||
|
||||
public deactivateAllThemes() {
|
||||
const activeThemes = this.activeThemes.slice()
|
||||
|
||||
for (const uuid of activeThemes) {
|
||||
this.deactivateTheme(uuid)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user