Skip to content

Commit 37ca070

Browse files
msivasubramaniaandgolovin
authored andcommitted
addressed the unit test bug
Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
1 parent 99cb268 commit 37ca070

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/webview/devfile-registry/app/home.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export const Home: React.FC<DefaultProps> = ({ }) => {
6363
if (message.data.action === 'getAllComponents') {
6464
if (message.data.errorMessage && message.data.errorMessage.length > 0) {
6565
setError(message.data.errorMessage);
66+
setCompDescriptions([]);
67+
setRegistries([]);
68+
setFilteredcompDescriptions([]);
6669
} else {
6770
setError('');
6871
if (message.data.registries.length === 1) {
@@ -126,7 +129,7 @@ export const Home: React.FC<DefaultProps> = ({ }) => {
126129
/>
127130
}
128131
<HomeItem compDescriptions={filteredcompDescriptions} />
129-
{error?.length > 0 ? <ErrorPage message='Devfiles not downloaded properly' /> : null}
132+
{error?.length > 0 ? <ErrorPage message={error} /> : null}
130133
</>
131134
:
132135
error?.length > 0 ? <ErrorPage message={error} /> : <LoadScreen />

src/webview/devfile-registry/registryViewLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default class RegistryViewLoader {
132132

133133
function getAllComponents(eventActionName: string, url?: string, error?: string) {
134134
let registries = ComponentTypesView.instance.getListOfRegistries();
135-
if (!registries) {
135+
if (!registries || registries.length === 0) {
136136
panel?.webview.postMessage(
137137
{
138138
action: eventActionName,

0 commit comments

Comments
 (0)