diff --git a/src/api/user.js b/src/api/user.js index 4a6ecc2c..8785f178 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -19,7 +19,11 @@ export function login(username, password) { subscriberId: subscriberId, }); }).catch((err)=>{ - reject(err); + if(err.status && err.status >= 400) { + reject(new Error(err.body.message)); + } else { + reject(err); + } }); }); } diff --git a/src/components/CscCall.vue b/src/components/CscCall.vue index 520291f8..94b7afd2 100644 --- a/src/components/CscCall.vue +++ b/src/components/CscCall.vue @@ -15,9 +15,9 @@ {{ $t('call.incoming') }} {{ $t('call.call') }} - - @@ -70,8 +70,11 @@ import { mapState, mapGetters } from 'vuex' import CscMedia from './CscMedia' import { QLayout, QCard, QCardTitle, QCardSeparator, QCardMain, QField, QInput, - QCardActions, QBtn, QIcon, Loading, Alert, QSpinnerRings, Dialog } from 'quasar-framework' + QCardActions, QBtn, QIcon, Loading, Alert, QSpinnerRings, Dialog, Platform } from 'quasar-framework' import { normalizeNumber, rawNumber } from '../filters/number-format' + import numberFormat from '../filters/number-format' + import { showCallNotification } from '../helpers/ui' + export default { name: 'csc-call', props: ['region', 'fullscreen'], @@ -270,6 +273,16 @@ ]), hasLocalVideo() { return this.getLocalMediaType !== null && this.getLocalMediaType.match(/(v|V)ideo/) !== null; + }, + isMobile() { + return Platform.is.mobile; + } + }, + watch: { + isIncoming(value) { + if(value) { + showCallNotification(numberFormat(this.getNumber)); + } } } } diff --git a/src/components/Login.vue b/src/components/Login.vue index da94f82a..1fb16251 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -32,9 +32,12 @@