updating state if no panel

This commit is contained in:
Peter Holmberg 2019-01-28 12:20:16 +01:00
parent 5082b66e3d
commit c9cab9b677

View File

@ -72,7 +72,6 @@ export class DashboardViewStateSrv {
}
_.extend(this.state, state);
this.dashboard.meta.fullscreen = this.state.fullscreen;
if (!this.state.fullscreen) {
this.state.fullscreen = null;
@ -117,10 +116,20 @@ export class DashboardViewStateSrv {
}
syncState() {
if (this.dashboard.meta.fullscreen) {
if (this.state.fullscreen) {
const panel = this.dashboard.getPanelById(this.state.panelId);
if (!panel) {
this.state.fullscreen = null;
this.state.panelId = null;
this.state.edit = null;
this.update(this.state);
setTimeout(() => {
appEvents.emit('alert-error', ['Error', 'Panel not found']);
}, 100);
return;
}