Skip to content

Commit bacda69

Browse files
committed
Added functionality for recovering debug reports
1 parent 2530cdb commit bacda69

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/dashboard/DashboardThunks.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,19 @@ export const loadDashboardThunk = (text) => (dispatch: any, getState: any) => {
6666
dispatch(resetDashboardState());
6767
return
6868
}
69-
const dashboard = JSON.parse(text);
69+
var dashboard = JSON.parse(text);
70+
71+
// Sanity check - make sure we didn't try to load a debug
72+
if (dashboard["_persist"] && dashboard["application"] && dashboard["dashboard"]) {
73+
dispatch(createNotificationThunk("Loaded a Debug Report", "Recovery-mode active. All report types were set to 'table'."));
74+
dashboard['dashboard']['pages'].map(p => {
75+
p['reports'].map(r => {
76+
r['type'] = 'table';
77+
})
78+
});
79+
dashboard = dashboard['dashboard'];
80+
}
81+
7082

7183
// Attempt upgrade if dashboard version is outdated.
7284
if (dashboard["version"] == "1.1") {

0 commit comments

Comments
 (0)