mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
Theme: Theme toggle is only persisted for signed in users (#33163)
This commit is contained in:
parent
888667abbc
commit
527b7bd756
@ -3,6 +3,7 @@ import { ThemeChangedEvent } from 'app/types/events';
|
||||
import appEvents from '../app_events';
|
||||
import { config } from '../config';
|
||||
import { PreferencesService } from './PreferencesService';
|
||||
import { contextSrv } from '../core';
|
||||
|
||||
export async function toggleTheme(runtimeOnly: boolean) {
|
||||
const currentTheme = config.theme;
|
||||
@ -32,6 +33,10 @@ export async function toggleTheme(runtimeOnly: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!contextSrv.isSignedIn) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Persist new theme
|
||||
const service = new PreferencesService('user');
|
||||
const currentPref = await service.load();
|
||||
|
Loading…
Reference in New Issue
Block a user