AppChrome: Fixes kiosk mode toggling (#58240)

This commit is contained in:
Torkel Ödegaard 2022-11-04 16:49:31 +01:00 committed by GitHub
parent cc8c1380e2
commit 4d2bf41efb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,10 @@
import { AppChromeService } from './AppChromeService';
describe('AppChromeService', () => {
it('onToggleKioskMode should set chromeless to true when searchbar is hidden', () => {
const chromeService = new AppChromeService();
chromeService.onToggleSearchBar();
chromeService.onToggleKioskMode();
expect(chromeService.state.getValue().chromeless).toBe(true);
});
});

View File

@ -57,11 +57,11 @@ export class AppChromeService {
this.routeChangeHandled = true;
}
Object.assign(newState, update);
// KioskMode overrides chromeless state
newState.chromeless = newState.kioskMode === KioskMode.Full || this.currentRoute?.chromeless;
Object.assign(newState, update);
if (!isShallowEqual(current, newState)) {
this.state.next(newState);
}