FS-8017 - Verto Communicator - fix uses of serialized verto in local storage
This commit is contained in:
parent
bd48aced25
commit
024f86ad02
|
@ -86,6 +86,7 @@ vertoControllers.controller('MainController', ['$scope', '$rootScope',
|
|||
storage.data.password = verto.data.password;
|
||||
|
||||
console.debug('Redirecting to dialpad page.');
|
||||
storage.changeData(verto);
|
||||
toastr.success('Login successful.', 'Welcome');
|
||||
$location.path('/dialpad');
|
||||
} else {
|
||||
|
@ -286,7 +287,7 @@ vertoControllers.controller('MainController', ['$scope', '$rootScope',
|
|||
title: 'Oops, Active Call in Course.',
|
||||
message: 'It seems you were in a call before leaving the last time. Wanna go back to that?'
|
||||
}).then(function() {
|
||||
verto.changeData(angular.fromJson(storage.data.verto));
|
||||
verto.changeData(storage);
|
||||
console.log('redirect to incall page');
|
||||
$location.path('/incall');
|
||||
}, function() {
|
||||
|
@ -653,13 +654,13 @@ vertoControllers.controller('ModalSettingsController', ['$scope', '$http',
|
|||
function($scope, $http, $location, $modalInstance, verto, storage) {
|
||||
console.debug('Executing ModalSettingsController.');
|
||||
|
||||
verto.changeData(storage);
|
||||
$scope.verto = verto;
|
||||
$scope.storage = storage;
|
||||
|
||||
$scope.ok = function() {
|
||||
storage.changeData(verto);
|
||||
$modalInstance.close('Ok.');
|
||||
storage.data.verto = angular.toJson($scope.verto);
|
||||
verto.changeData($scope.verto);
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
var storageService = angular.module('storageService', ['ngStorage']);
|
||||
|
||||
storageService.service('storage', ['$rootScope', '$localStorage', 'verto',
|
||||
function($rootScope, $localStorage, verto) {
|
||||
storageService.service('storage', ['$rootScope', '$localStorage',
|
||||
function($rootScope, $localStorage) {
|
||||
var data = $localStorage;
|
||||
|
||||
data.$default({
|
||||
|
@ -21,11 +21,40 @@ storageService.service('storage', ['$rootScope', '$localStorage', 'verto',
|
|||
userStatus: 'disconnected',
|
||||
mutedVideo: false,
|
||||
mutedMic: false,
|
||||
verto: angular.toJson(verto)
|
||||
selectedVideo: null,
|
||||
selectedAudio: null,
|
||||
selectedShare: null,
|
||||
useVideo: '',
|
||||
useCamera: '',
|
||||
useVideo: '',
|
||||
useCamera: '',
|
||||
useStereo: '',
|
||||
useSTUN: '',
|
||||
useDedenc: '',
|
||||
mirrorInput: '',
|
||||
outgoingBandwidth: '',
|
||||
incomingBandwidth: '',
|
||||
vidQual: ''
|
||||
});
|
||||
|
||||
function changeData(verto_data) {
|
||||
data.selectedVideo = verto_data.data.selectedVideo;
|
||||
data.selectedAudio = verto_data.data.selectedAudio;
|
||||
data.selectedShare = verto_data.data.selectedShare;
|
||||
data.useVideo = verto_data.data.useVideo;
|
||||
data.useCamera = verto_data.data.useCamera;
|
||||
data.useStereo = verto_data.data.useStereo;
|
||||
data.useDedenc = verto_data.data.useDedenc;
|
||||
data.useSTUN = verto_data.data.useSTUN;
|
||||
data.vidQual = verto_data.data.vidQual;
|
||||
data.mirrorInput = verto_data.data.mirrorInput;
|
||||
data.outgoingBandwidth = verto_data.data.outgoingBandwidth;
|
||||
data.incomingBandwidth = verto_data.data.incomingBandwidth;
|
||||
}
|
||||
|
||||
return {
|
||||
data: data,
|
||||
changeData: changeData,
|
||||
reset: function() {
|
||||
data.ui_connected = false;
|
||||
data.ws_connected = false;
|
||||
|
|
|
@ -203,6 +203,9 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location',
|
|||
$cookieStore.put('verto_demo_incomingBandwidth', verto_data.data.incomingBandwidth);
|
||||
$cookieStore.put('verto_demo_vqual', verto_data.data.vidQual);
|
||||
|
||||
data.selectedVideo = verto_data.data.selectedVideo;
|
||||
data.selectedAudio = verto_data.data.selectedAudio;
|
||||
data.selectedShare = verto_data.data.selectedShare;
|
||||
data.useVideo = verto_data.data.useVideo;
|
||||
data.useCamera = verto_data.data.useCamera;
|
||||
data.useStereo = verto_data.data.useStereo;
|
||||
|
@ -280,7 +283,6 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location',
|
|||
});
|
||||
}
|
||||
|
||||
data.audioDevices = [];
|
||||
for (var i in jQuery.verto.audioDevices) {
|
||||
var device = jQuery.verto.audioDevices[i];
|
||||
// Selecting the first source.
|
||||
|
|
Loading…
Reference in New Issue