mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Use optional chaining
This commit is contained in:
parent
0a648eddae
commit
5578509822
2 changed files with 6 additions and 12 deletions
|
|
@ -350,9 +350,7 @@ export default {
|
||||||
getAppCategory,
|
getAppCategory,
|
||||||
getAppEndpoint,
|
getAppEndpoint,
|
||||||
getSearchLinks (app) {
|
getSearchLinks (app) {
|
||||||
if (typeof app.searchLinks === 'undefined') return []
|
return app?.searchLinks || []
|
||||||
|
|
||||||
return app.searchLinks
|
|
||||||
},
|
},
|
||||||
// Search priorities
|
// Search priorities
|
||||||
titleStartsWith (query, app) {
|
titleStartsWith (query, app) {
|
||||||
|
|
|
||||||
|
|
@ -92,11 +92,11 @@ export default {
|
||||||
// Filter app list to leave out data not needed for search
|
// Filter app list to leave out data not needed for search
|
||||||
initialAppList: sortedAppList.map( app => {
|
initialAppList: sortedAppList.map( app => {
|
||||||
|
|
||||||
let searchLinks = []
|
const searchLinks = allAppSearchLinks?.[app.slug] || []
|
||||||
|
|
||||||
if (typeof allAppSearchLinks[app.slug] !== 'undefined') {
|
// if (typeof allAppSearchLinks[app.slug] !== 'undefined') {
|
||||||
searchLinks = allAppSearchLinks[app.slug]
|
// searchLinks = allAppSearchLinks[app.slug]
|
||||||
}
|
// }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: app.name,
|
name: app.name,
|
||||||
|
|
@ -211,11 +211,7 @@ export default {
|
||||||
|
|
||||||
this.fetchedAppList = fetchedLists.flat(1).map( app => {
|
this.fetchedAppList = fetchedLists.flat(1).map( app => {
|
||||||
|
|
||||||
let searchLinks = []
|
const searchLinks = this.allAppSearchLinks?.[app.slug] || []
|
||||||
|
|
||||||
if (typeof this.allAppSearchLinks[app.slug] !== 'undefined') {
|
|
||||||
searchLinks = this.allAppSearchLinks[app.slug]
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...app,
|
...app,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue