Skip to content

Commit a8effdd

Browse files
committed
chore: Fix sonar warnings
1 parent 4d8ac38 commit a8effdd

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

src/features/instance/applications/context/EditorViewProvider.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,11 @@ export function EditorViewProvider({ children }: PropsWithChildren) {
3838
const queryClient = useQueryClient();
3939
const { open }: { open?: string } = useSearch({ strict: false });
4040

41-
const reloadRootEntries = useCallback(async () => {
42-
// await queryClient.invalidateQueries({
43-
// queryKey: [instanceParams.entityId, 'get_components'],
44-
// refetchType: 'active',
45-
// });
46-
return queryClient.fetchQuery<APIDirectoryEntry>({
41+
const reloadRootEntries = useCallback(async () =>
42+
queryClient.fetchQuery<APIDirectoryEntry>({
4743
queryKey: [instanceParams.entityId, 'get_components'],
4844
networkMode: 'online',
49-
});
50-
}, [queryClient, instanceParams]);
45+
}), [queryClient, instanceParams]);
5146

5247
/*
5348
Create our structured view from the relational API data.

src/features/instance/applications/lib/parseReadMe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export function parseReadMe(contents: string, baseURL: string, response: GetComp
44
const operations9925URL = baseURL;
55
const rest9926URL = baseURL.replace(':9925', '');
66
if (operations9925URL) {
7-
contents = contents.replace(/http:\/\/localhost:9926/g, rest9926URL);
7+
contents = contents.replaceAll('http://localhost:9926', rest9926URL);
88
}
99
if (response.project) {
10-
contents = contents.replace(/Your New Harper Fabric App/g, response.project);
10+
contents = contents.replaceAll('Your New Harper Fabric App', response.project);
1111
}
1212
return contents;
1313
}

src/integrations/github/getGitHubRepo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export async function getGitHubRepo(url: URL) {
2-
if (url && url.pathname && url.hostname.includes('github.com')) {
2+
if (url?.pathname && url.hostname.includes('github.com')) {
33
const parts = url.pathname.split('/').filter(Boolean);
44

55
try {

src/integrations/github/getGitHubTags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export async function getGitHubTags(user: string, repo: string) {
33

44
if (response.status < 400) {
55
const tagData = await response.json();
6-
return tagData.map((tag: { ref: string }) => tag.ref.split('/').slice(-1)[0]);
6+
return tagData.map((tag: { ref: string }) => tag.ref.split('/').at(1));
77
}
88

99
return [];

0 commit comments

Comments
 (0)