Removing group when last client is removed from it

This commit is contained in:
James Barnsley
2020-05-16 19:27:24 +12:00
parent afb06bac4a
commit 98167e7c6f
6 changed files with 11 additions and 9 deletions

View File

@ -177,6 +177,7 @@ export function groupsLoaded(groups, flush = false) {
return {
type: 'SNAPCAST_GROUPS_LOADED',
groups,
flush,
};
}

View File

@ -483,10 +483,10 @@ const SnapcastMiddleware = (function () {
request(store, 'Group.SetClients', params)
.then(
response => {
(response) => {
store.dispatch(snapcastActions.groupsLoaded(response.server.groups, true));
},
error => {
(error) => {
store.dispatch(coreActions.handleException(
'Error',
error,
@ -497,19 +497,19 @@ const SnapcastMiddleware = (function () {
break;
case 'SNAPCAST_DELETE_CLIENT':
var params = {
const params = {
id: action.id,
};
request(store, 'Server.DeleteClient', params)
.then(
response => {
() => {
store.dispatch({
type: 'SNAPCAST_CLIENT_REMOVED',
key: action.data.params.id,
});
},
error => {
(error) => {
store.dispatch(coreActions.handleException(
'Error',
error,