added option to enable and disable sound
This commit is contained in:
parent
f1c7515274
commit
f8baca943c
4 changed files with 22 additions and 1 deletions
|
|
@ -607,7 +607,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
(processName == 'sendingTx' && !$scope.wallet.canSign() && !$scope.wallet.isPrivKeyExternal())
|
||||
) && !isOn) {
|
||||
$scope.sendStatus = 'success';
|
||||
if ($scope.wallet.coin == 'bch') {
|
||||
if (config.soundsEnabled && $scope.wallet.coin == 'bch') {
|
||||
var audio = new Audio('misc/bch_sent.mp3');
|
||||
audio.play();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr
|
|||
value: isEmailEnabled && $scope.newEmail.value ? true : false
|
||||
};
|
||||
|
||||
var isSoundEnabled = config.soundsEnabled ? config.soundsEnabled : false;
|
||||
$scope.sounds = {
|
||||
value: isSoundEnabled
|
||||
};
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
|
|
@ -72,6 +77,16 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr
|
|||
emailService.updateEmail(opts);
|
||||
};
|
||||
|
||||
$scope.soundNotificationsChange = function() {
|
||||
if (!$scope.sounds) return;
|
||||
var opts = {
|
||||
soundsEnabled: $scope.sounds.value
|
||||
};
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.save = function() {
|
||||
emailService.updateEmail({
|
||||
enabled: $scope.emailNotifications.value,
|
||||
|
|
|
|||
|
|
@ -106,6 +106,8 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
|||
enabled: false,
|
||||
},
|
||||
|
||||
soundsEnabled: false,
|
||||
|
||||
log: {
|
||||
filter: 'debug',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@
|
|||
<span class="toggle-label" translate>Enable email notifications</span>
|
||||
</ion-toggle>
|
||||
|
||||
<ion-toggle ng-model="sounds.value" toggle-class="toggle-balanced" ng-change="soundNotificationsChange()">
|
||||
<span class="toggle-label" translate>Enable sound</span>
|
||||
</ion-toggle>
|
||||
|
||||
<div ng-if="emailNotifications.value">
|
||||
<div class="settings-explanation">
|
||||
<div class="settings-description" translate>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue