From c3b8b92df6dcc08a392a23161fbce03f5a486f50 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Fri, 12 Jan 2018 06:59:07 -0800 Subject: [PATCH] Use constants --- js/reducers/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/reducers/index.js b/js/reducers/index.js index a50e2de5..2eeabd03 100644 --- a/js/reducers/index.js +++ b/js/reducers/index.js @@ -1,6 +1,11 @@ import { combineReducers } from "redux"; import { BANDS, WINDOWS } from "../constants"; import { + PLAY, + IS_PLAYING, + PAUSE, + STOP, + IS_STOPPED, CLOSE_WINAMP, SET_BALANCE, SET_BAND_VALUE, @@ -230,13 +235,13 @@ const media = (state, action) => { } switch (action.type) { // TODO: Make these constants - case "PLAY": - case "IS_PLAYING": + case PLAY: + case IS_PLAYING: return { ...state, status: "PLAYING" }; - case "PAUSE": + case PAUSE: return { ...state, status: "PAUSED" }; - case "STOP": - case "IS_STOPPED": + case STOP: + case IS_STOPPED: return { ...state, status: "STOPPED" }; case TOGGLE_TIME_MODE: const newMode = state.timeMode === "REMAINING" ? "ELAPSED" : "REMAINING";