fix: deactivate themes when switching accounts

This commit is contained in:
Mo
2022-02-08 21:51:06 -06:00
parent e43c8a6f07
commit d920bf663f
4 changed files with 4 additions and 10 deletions

View File

@@ -527,7 +527,6 @@ export class Footer extends PureComponent<Props, State> {
className="sk-app-bar-item" className="sk-app-bar-item"
> >
<div <div
id="account-switcher-icon"
className={ className={
(this.state.hasPasscode ? 'alone' : '') + (this.state.hasPasscode ? 'alone' : '') +
' flex items-center' ' flex items-center'

View File

@@ -170,7 +170,7 @@ export class ThemeManager extends ApplicationService {
); );
} }
private deactivateAllThemes() { public deactivateAllThemes() {
const activeThemes = this.activeThemes.slice(); const activeThemes = this.activeThemes.slice();
for (const uuid of activeThemes) { for (const uuid of activeThemes) {
this.deactivateTheme(uuid); this.deactivateTheme(uuid);

View File

@@ -73,6 +73,9 @@ export class WebApplication extends SNApplication {
deinit(source: DeinitSource): void { deinit(source: DeinitSource): void {
super.deinit(source); super.deinit(source);
try { try {
if (source === DeinitSource.AppGroupUnload) {
this.getThemeService().deactivateAllThemes();
}
for (const service of Object.values(this.webServices)) { for (const service of Object.values(this.webServices)) {
if ('deinit' in service) { if ('deinit' in service) {
service.deinit?.(source); service.deinit?.(source);

View File

@@ -44,14 +44,6 @@
} }
} }
#account-switcher-icon {
// When this icon is alone in the footer bar, it is displayed with too little
// padding on the right, possibly due to the fact it is a raw SVG.
&.alone {
margin-right: 4px;
}
}
#account-panel, #account-panel,
#sync-resolution-menu { #sync-resolution-menu {
width: 400px; width: 400px;