Commit 994c79b5 by Torkel Ödegaard

Merge branch '15048/navigate-from-not-saved-panel'

parents dc125f1e 520756fb
......@@ -58,7 +58,6 @@ describe('when updating view state', () => {
it('should remove params from query string', () => {
viewState.update({ fullscreen: true, panelId: 1, edit: true });
viewState.update({ fullscreen: false });
expect(viewState.dashboard.meta.fullscreen).toBe(false);
expect(viewState.state.fullscreen).toBe(null);
});
});
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment