mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Move deviceSupportsApp into helper
This commit is contained in:
parent
8eaf958f7b
commit
6e65c498c8
2 changed files with 38 additions and 35 deletions
37
helpers/devices.js
Normal file
37
helpers/devices.js
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
|
||||||
|
import { getStatusName } from './statuses.js'
|
||||||
|
|
||||||
|
|
||||||
|
export const macAppleSiliconStatuses = new Set([
|
||||||
|
'native',
|
||||||
|
'rosetta'
|
||||||
|
])
|
||||||
|
|
||||||
|
export function deviceSupportsApp ( device, app ) {
|
||||||
|
|
||||||
|
// const statuses = {
|
||||||
|
// '✅': 'native',
|
||||||
|
// '✳️': 'rosetta',
|
||||||
|
// '⏹': 'no-in-progress',
|
||||||
|
// '🚫': 'no',
|
||||||
|
// '🔶': 'unreported',
|
||||||
|
// }
|
||||||
|
const appStatus = getStatusName( app.text )
|
||||||
|
|
||||||
|
if ( device.type === 'intel') {
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( device.type === 'mac-apple-silicon') {
|
||||||
|
|
||||||
|
return macAppleSiliconStatuses.has( appStatus )
|
||||||
|
}
|
||||||
|
|
||||||
|
// if ( device.type === 'ios') {
|
||||||
|
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
@ -57,41 +57,7 @@ import Search from '~/components/search.vue'
|
||||||
import LinkButton from '~/components/link-button.vue'
|
import LinkButton from '~/components/link-button.vue'
|
||||||
|
|
||||||
// import { categories } from '~/helpers/categories.js'
|
// import { categories } from '~/helpers/categories.js'
|
||||||
import { getStatusName } from '~/helpers/statuses.js'
|
import { deviceSupportsApp } from '~/helpers/devices.js'
|
||||||
|
|
||||||
const macAppleSiliconStatuses = new Set([
|
|
||||||
'native',
|
|
||||||
'rosetta'
|
|
||||||
])
|
|
||||||
|
|
||||||
function deviceSupportsApp ( device, app ) {
|
|
||||||
|
|
||||||
// const statuses = {
|
|
||||||
// '✅': 'native',
|
|
||||||
// '✳️': 'rosetta',
|
|
||||||
// '⏹': 'no-in-progress',
|
|
||||||
// '🚫': 'no',
|
|
||||||
// '🔶': 'unreported',
|
|
||||||
// }
|
|
||||||
const appStatus = getStatusName( app.text )
|
|
||||||
|
|
||||||
if ( device.type === 'intel') {
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( device.type === 'mac-apple-silicon') {
|
|
||||||
|
|
||||||
return macAppleSiliconStatuses.has( appStatus )
|
|
||||||
}
|
|
||||||
|
|
||||||
// if ( device.type === 'ios') {
|
|
||||||
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async asyncData ({ params: { slug } }) {
|
async asyncData ({ params: { slug } }) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue