Added behavior to mark active server in servers dropdown

This commit is contained in:
Alejandro Celaya
2018-07-18 20:26:45 +02:00
parent fb407da3e8
commit e1049a74a2
6 changed files with 50 additions and 14 deletions

View File

@@ -1,10 +1,16 @@
import { LIST_SHORT_URLS } from '../../short-urls/reducers/shortUrlsList';
const RESET_SELECTED_SERVER = 'shlink/selectedServer/RESET_SELECTED_SERVER';
export default function reducer(state = null, action) {
switch (action.type) {
case LIST_SHORT_URLS:
return action.selectedServer;
case RESET_SELECTED_SERVER:
return null;
default:
return state;
}
}
export const resetSelectedServer = () => ({ type: RESET_SELECTED_SERVER });