Skip to content

Commit b4785d5

Browse files
committed
fix: stop view
1 parent 0fc0dd4 commit b4785d5

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,30 @@ export function QueryResultViewer({
216216
);
217217
};
218218

219+
const renderErrorView = () => {
220+
const isStopped = isQueryCancelledError(error);
221+
return (
222+
<Flex justifyContent="center" alignItems="center" width="100%">
223+
<EmptyState
224+
size="s"
225+
image={<Illustration name="error" />}
226+
title={isStopped ? i18n('stopped.title') : i18n('error.title')}
227+
description={
228+
<Text color="complementary">
229+
{isStopped ? i18n('stopped.description') : i18n('error.description')}
230+
</Text>
231+
}
232+
/>
233+
</Flex>
234+
);
235+
};
236+
219237
const renderResultSection = () => {
220238
if (activeSection === RESULT_OPTIONS_IDS.result) {
239+
if (error && !resultSets?.length) {
240+
return renderErrorView();
241+
}
242+
221243
return (
222244
<ResultSetsViewer
223245
resultSets={resultSets}
@@ -230,23 +252,7 @@ export function QueryResultViewer({
230252
}
231253

232254
if (error) {
233-
const isStopped = isQueryCancelledError(error);
234-
return (
235-
<Flex justifyContent="center" alignItems="center" width="100%">
236-
<EmptyState
237-
size="s"
238-
image={<Illustration name="error" />}
239-
title={isStopped ? i18n('stopped.title') : i18n('error.title')}
240-
description={
241-
<Text color="complementary">
242-
{isStopped
243-
? i18n('stopped.description')
244-
: i18n('error.description')}
245-
</Text>
246-
}
247-
/>
248-
</Flex>
249-
);
255+
return renderErrorView();
250256
}
251257

252258
if (activeSection === RESULT_OPTIONS_IDS.schema) {

0 commit comments

Comments
 (0)