Skip to content

Commit

Permalink
moved filter to api call
Browse files Browse the repository at this point in the history
  • Loading branch information
lenareed committed Sep 11, 2024
1 parent 1f31469 commit f70bbdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/api/llm/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function sendUserRating(

export async function fetchAppNames(creds: Credentials) {
const response = await fetch(
`https://${getDomain(creds.region)}/v1/storage/files`,
`https://${getDomain(creds.region)}/v1/storage/files?kind=ios&kind=android`,
{
method: 'GET',
headers: {
Expand Down
9 changes: 2 additions & 7 deletions webview-ui/test-generation/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,9 @@ function App() {
loadedAppInfo,
} = state;

const filteredAppInfo = loadedAppInfo.filter((item) =>
['android', 'ios'].includes(item.kind),
);
const loadedAppNames: string[] = filteredAppInfo.map((map) => map.name);
const loadedAppNames: string[] = loadedAppInfo.map((map) => map.name);
const appNameToPlatform = new Map<string, string>();
filteredAppInfo.forEach((item) =>
appNameToPlatform.set(item.name, item.kind),
);
loadedAppInfo.forEach((item) => appNameToPlatform.set(item.name, item.kind));
let seenHistoryAppName = appName == ''; // if appName is empty, we don't need to add appName later
const optionElements: JSX.Element[] = [];
for (let i = 0; i < loadedAppNames.length; i++) {
Expand Down

0 comments on commit f70bbdb

Please sign in to comment.