Making sure we do not pass a long invalid queries and save to state

This commit is contained in:
Hugo Häggmark 2019-01-28 15:27:35 +01:00
parent edfce0893e
commit 08f5a3338a
2 changed files with 3 additions and 1 deletions

View File

@ -538,6 +538,7 @@ export function runQueries(exploreId: ExploreId) {
if (!hasNonEmptyQuery(modifiedQueries)) { if (!hasNonEmptyQuery(modifiedQueries)) {
dispatch({ type: ActionTypes.RunQueriesEmpty, payload: { exploreId } }); dispatch({ type: ActionTypes.RunQueriesEmpty, payload: { exploreId } });
dispatch(stateSave()); // Remember to saves to state and update location
return; return;
} }

View File

@ -173,8 +173,9 @@ export default class LokiLanguageProvider extends LanguageProvider {
}) })
); );
} }
// Return a cleaned LokiQuery
return queries.map(query => ({ return queries.map(query => ({
...query, refId: query.refId,
expr: '', expr: '',
})); }));
} }