Make fetch cordova compatible
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -120,7 +120,6 @@
|
|||||||
import submitMixin from './submit-mixin'
|
import submitMixin from './submit-mixin'
|
||||||
import detectionMixin from './detection-mixin'
|
import detectionMixin from './detection-mixin'
|
||||||
import cameraMixin from './camera-mixin'
|
import cameraMixin from './camera-mixin'
|
||||||
import App from 'framework7-vue/components/app'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [submitMixin, detectionMixin, cameraMixin],
|
mixins: [submitMixin, detectionMixin, cameraMixin],
|
||||||
@@ -188,7 +187,7 @@ import App from 'framework7-vue/components/app'
|
|||||||
}
|
}
|
||||||
this.modelLocation = `${modelRoot}/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
this.modelLocation = `${modelRoot}/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
||||||
this.miniLocation = `${modelRoot}/models/${this.detectorName}-mini/model.json`
|
this.miniLocation = `${modelRoot}/models/${this.detectorName}-mini/model.json`
|
||||||
fetch(`./models/${this.detectorName}/classes.json`)
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/${this.detectorName}/classes.json`)
|
||||||
.then((mod) => { return mod.json() })
|
.then((mod) => { return mod.json() })
|
||||||
.then((classes) => {
|
.then((classes) => {
|
||||||
this.classesList = classes
|
this.classesList = classes
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
limbsDetails: { "version": "N/A" },
|
limbsDetails: { "version": "N/A" },
|
||||||
headneckDetails: { "version": "N/A" },
|
headneckDetails: { "version": "N/A" },
|
||||||
alvinnVersion: store().getVersion,
|
alvinnVersion: store().getVersion,
|
||||||
|
isCordova: !!window.cordova,
|
||||||
otherSettings: {}
|
otherSettings: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -54,16 +55,16 @@
|
|||||||
created () {
|
created () {
|
||||||
var loadOtherSettings = localStorage.getItem('otherSettings')
|
var loadOtherSettings = localStorage.getItem('otherSettings')
|
||||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||||
fetch('./models/thorax/descript.json')
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/thorax/descript.json`)
|
||||||
.then((mod) => { return mod.json() })
|
.then((mod) => { return mod.json() })
|
||||||
.then((desc) => { this.thoraxDetails = desc })
|
.then((desc) => { this.thoraxDetails = desc })
|
||||||
fetch('./models/thorax-mini/descript.json')
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/thorax-mini/descript.json`)
|
||||||
.then((mod) => { return mod.json() })
|
.then((mod) => { return mod.json() })
|
||||||
.then((desc) => { this.miniThoraxDetails = desc })
|
.then((desc) => { this.miniThoraxDetails = desc })
|
||||||
fetch('./models/abdomen/descript.json')
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/abdomen/descript.json`)
|
||||||
.then((mod) => { return mod.json() })
|
.then((mod) => { return mod.json() })
|
||||||
.then((desc) => { this.abdomenDetails = desc })
|
.then((desc) => { this.abdomenDetails = desc })
|
||||||
fetch('./models/abdomen-mini/descript.json')
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/abdomen-mini/descript.json`)
|
||||||
.then((mod) => { return mod.json() })
|
.then((mod) => { return mod.json() })
|
||||||
.then((desc) => { this.miniAbdomenDetails = desc })
|
.then((desc) => { this.miniAbdomenDetails = desc })
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user