Skip to content
Snippets Groups Projects

Resolve "Improve sockets"

Merged Victor Löfgren requested to merge 178-improve-sockets into dev
15 files
+ 239
410
Compare changes
  • Side-by-side
  • Inline
Files
15
@@ -3,8 +3,8 @@ This file handles actions for the presentation redux state
@@ -3,8 +3,8 @@ This file handles actions for the presentation redux state
*/
*/
import axios from 'axios'
import axios from 'axios'
import { Timer } from '../interfaces/Timer'
import { TimerState } from '../interfaces/Timer'
import store, { AppDispatch, RootState } from './../store'
import { AppDispatch, RootState } from './../store'
import Types from './types'
import Types from './types'
/** Save competition in presentation state from input id */
/** Save competition in presentation state from input id */
@@ -35,18 +35,8 @@ export const setCurrentSlideByOrder = (order: number) => (dispatch: AppDispatch,
@@ -35,18 +35,8 @@ export const setCurrentSlideByOrder = (order: number) => (dispatch: AppDispatch,
export const setPresentationCode = (code: string) => (dispatch: AppDispatch) => {
export const setPresentationCode = (code: string) => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_CODE, payload: code })
dispatch({ type: Types.SET_PRESENTATION_CODE, payload: code })
}
}
 
/** Set timer to input value */
/** Set timer to input value */
export const setPresentationTimer = (timer: Timer) => (dispatch: AppDispatch) => {
export const setPresentationTimer = (timer: TimerState) => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_TIMER, payload: timer })
dispatch({ type: Types.SET_PRESENTATION_TIMER, payload: timer })
}
}
/** Decrement timer */
export const setPresentationTimerDecrement = () => (dispatch: AppDispatch) => {
dispatch({
type: Types.SET_PRESENTATION_TIMER,
payload: {
enabled: store.getState().presentation.timer.enabled,
value: store.getState().presentation.timer.value - 1,
},
})
}
Loading