Skip to content

Commit

Permalink
fix: deactivate themes when switching accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Feb 9, 2022
1 parent e43c8a6 commit d920bf6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/components/Footer.tsx
Expand Up @@ -527,7 +527,6 @@ export class Footer extends PureComponent<Props, State> {
className="sk-app-bar-item"
>
<div
id="account-switcher-icon"
className={
(this.state.hasPasscode ? 'alone' : '') +
' flex items-center'
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/services/themeManager.ts
Expand Up @@ -170,7 +170,7 @@ export class ThemeManager extends ApplicationService {
);
}

private deactivateAllThemes() {
public deactivateAllThemes() {
const activeThemes = this.activeThemes.slice();
for (const uuid of activeThemes) {
this.deactivateTheme(uuid);
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/ui_models/application.ts
Expand Up @@ -73,6 +73,9 @@ export class WebApplication extends SNApplication {
deinit(source: DeinitSource): void {
super.deinit(source);
try {
if (source === DeinitSource.AppGroupUnload) {
this.getThemeService().deactivateAllThemes();
}
for (const service of Object.values(this.webServices)) {
if ('deinit' in service) {
service.deinit?.(source);
Expand Down
8 changes: 0 additions & 8 deletions app/assets/stylesheets/_footer.scss
Expand Up @@ -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,
#sync-resolution-menu {
width: 400px;
Expand Down

0 comments on commit d920bf6

Please sign in to comment.