Move userAgent getting to VueX
This commit is contained in:
parent
bc94ea898f
commit
0b3121bfe5
2 changed files with 11 additions and 8 deletions
|
|
@ -45,7 +45,7 @@
|
||||||
If you are on one of those devices and you still see this message,
|
If you are on one of those devices and you still see this message,
|
||||||
please contact "ghostwriter{at}resonym.com" with the following information:
|
please contact "ghostwriter{at}resonym.com" with the following information:
|
||||||
<br><br>
|
<br><br>
|
||||||
{{ userAgent }}
|
{{ $store.getters.userAgent }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -76,14 +76,8 @@ export default {
|
||||||
gameState() {
|
gameState() {
|
||||||
return this.$store.state.view;
|
return this.$store.state.view;
|
||||||
},
|
},
|
||||||
userAgent() {
|
|
||||||
if (navigator == null) {
|
|
||||||
return "Navigator Undefined";
|
|
||||||
};
|
|
||||||
return navigator.userAgent;
|
|
||||||
},
|
|
||||||
isMobile () {
|
isMobile () {
|
||||||
return this.userAgent.match(/(Navigator Undefined)|iPhone|iPod|Android/) != null;
|
return this.$store.getters.userAgent.match(/(Navigator Undefined)|iPhone|iPod|Android/) != null;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,15 @@ export default new Vuex.Store({
|
||||||
};
|
};
|
||||||
return ``;
|
return ``;
|
||||||
},
|
},
|
||||||
|
userAgent() {
|
||||||
|
if (navigator == null) {
|
||||||
|
return "Navigator Undefined";
|
||||||
|
};
|
||||||
|
return navigator.userAgent;
|
||||||
|
},
|
||||||
|
isFirefox(state, getters) {
|
||||||
|
return getters.userAgent.match(/(Navigator Undefined)|Firefox/g) != null;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
resetState(state) {
|
resetState(state) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue