mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
leap: destructure selection logic variables
This commit is contained in:
parent
55e60c6f87
commit
5424730949
@ -179,18 +179,15 @@ export class Omnibox extends Component {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
if (currentIndex > 0) {
|
if (currentIndex > 0) {
|
||||||
const nextApp = flattenedResults[currentIndex - 1].app;
|
const { app, link } = flattenedResults[currentIndex - 1];
|
||||||
const nextLink = flattenedResults[currentIndex - 1].link;
|
this.setState({ selected: [app, link] });
|
||||||
this.setState({ selected: [nextApp, nextLink] });
|
|
||||||
} else {
|
} else {
|
||||||
const nextApp = flattenedResults[totalLength - 1].app;
|
const { app, link } = flattenedResults[totalLength - 1];
|
||||||
const nextLink = flattenedResults[totalLength - 1].link;
|
this.setState({ selected: [app, link] });
|
||||||
this.setState({ selected: [nextApp, nextLink] });
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const nextApp = flattenedResults[totalLength - 1].app;
|
const { app, link } = flattenedResults[totalLength - 1];
|
||||||
const nextLink = flattenedResults[totalLength - 1].link;
|
this.setState({ selected: [app, link] });
|
||||||
this.setState({ selected: [nextApp, nextLink] });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,18 +201,15 @@ export class Omnibox extends Component {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
if (currentIndex < flattenedResults.length - 1) {
|
if (currentIndex < flattenedResults.length - 1) {
|
||||||
const nextApp = flattenedResults[currentIndex + 1].app;
|
const { app, link } = flattenedResults[currentIndex + 1];
|
||||||
const nextLink = flattenedResults[currentIndex + 1].link;
|
this.setState({ selected: [app, link] });
|
||||||
this.setState({ selected: [nextApp, nextLink] });
|
|
||||||
} else {
|
} else {
|
||||||
const nextApp = flattenedResults[0].app;
|
const { app, link } = flattenedResults[0];
|
||||||
const nextLink = flattenedResults[0].link;
|
this.setState({ selected: [app, link] });
|
||||||
this.setState({ selected: [nextApp, nextLink] });
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const nextApp = flattenedResults[0].app;
|
const { app, link } = flattenedResults[0];
|
||||||
const nextLink = flattenedResults[0].link;
|
this.setState({ selected: [app, link] });
|
||||||
this.setState({ selected: [nextApp, nextLink] });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user