|
@@ -6,6 +6,17 @@ import { state as helpState } from './helpState'
|
|
|
export const browser = () => {
|
|
|
const u = navigator.userAgent
|
|
|
|
|
|
+
|
|
|
+ let instance: any
|
|
|
+ if (u.indexOf('ORCHESTRASTUDENT') > -1) {
|
|
|
+ instance =
|
|
|
+ (window as any).ORCHESTRA ||
|
|
|
+ (window as any).webkit?.messageHandlers?.ORCHESTRA
|
|
|
+ } else {
|
|
|
+ instance =
|
|
|
+ (window as any).COLEXIU ||
|
|
|
+ (window as any).webkit?.messageHandlers?.COLEXIU
|
|
|
+ }
|
|
|
return {
|
|
|
trident: u.indexOf('Trident') > -1,
|
|
|
presto: u.indexOf('Presto') > -1,
|
|
@@ -16,11 +27,12 @@ export const browser = () => {
|
|
|
|
|
|
android: u.indexOf('COLEXIUAPPA') > -1 || u.indexOf('Adr') > -1,
|
|
|
iPhone: u.indexOf('COLEXIUAPPI') > -1,
|
|
|
- isApp:
|
|
|
- u.indexOf('COLEXIUAPPI') > -1 ||
|
|
|
- u.indexOf('COLEXIUAPPA') > -1 ||
|
|
|
- u.indexOf('ORCHESTRASTUDENT') > -1 ||
|
|
|
- u.indexOf('Adr') > -1,
|
|
|
+ isApp: instance ? true : false,
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
isTeacher: u.indexOf('COLEXIUTEACHER') > -1,
|
|
|
isStudent: u.indexOf('COLEXIUSTUDENT') > -1,
|
|
|
isOrchestraStudent: u.indexOf('ORCHESTRASTUDENT') > -1,
|