Browse Source

Fixes reversed logic

main
Eric Amodio 2 years ago
parent
commit
13da01b246
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/webviews/apps/plus/graph/GraphWrapper.tsx

+ 7
- 7
src/webviews/apps/plus/graph/GraphWrapper.tsx View File

@ -289,8 +289,8 @@ export function GraphWrapper({
if (next) { if (next) {
if (rowIndex < resultIds.length - 1) { if (rowIndex < resultIds.length - 1) {
rowIndex++; rowIndex++;
} else if (hasMoreSearchResults) {
const results = await onSearchCommitsPromise?.(search!, { more: true });
} else if (search != null && hasMoreSearchResults) {
const results = await onSearchCommitsPromise?.(search, { more: true });
if (results?.results != null) { if (results?.results != null) {
if (resultIds.length < results.results.ids.length) { if (resultIds.length < results.results.ids.length) {
resultIds = results.results.ids; resultIds = results.results.ids;
@ -307,8 +307,8 @@ export function GraphWrapper({
} else if (rowIndex > 0) { } else if (rowIndex > 0) {
rowIndex--; rowIndex--;
} else { } else {
if (hasMoreSearchResults) {
const results = await onSearchCommitsPromise?.(search!, { more: { limit: 0 } });
if (search != null && hasMoreSearchResults) {
const results = await onSearchCommitsPromise?.(search, { more: { limit: 0 } });
if (results?.results != null) { if (results?.results != null) {
if (resultIds.length < results.results.ids.length) { if (resultIds.length < results.results.ids.length) {
resultIds = results.results.ids; resultIds = results.results.ids;
@ -351,12 +351,12 @@ export function GraphWrapper({
const detail = e.detail; const detail = e.detail;
setSearch(detail); setSearch(detail);
const inValid = detail.pattern.length &lt; 3;
if (inValid) {
const isValid = detail.pattern.length &gt;= 3;
if (!isValid) {
setSearchResultKey(undefined); setSearchResultKey(undefined);
setSearchResultIds(undefined); setSearchResultIds(undefined);
} }
onSearchCommits?.(inValid ? undefined : detail);
onSearchCommits?.(isValid ? detail : undefined);
}; };
useLayoutEffect(() => { useLayoutEffect(() => {

Loading…
Cancel
Save