fix: deactivate themes when switching accounts
This commit is contained in:
@@ -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'
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user