diff --git a/client/components/Channels.tsx b/client/components/Channels.tsx index a82c3c09..5253102d 100644 --- a/client/components/Channels.tsx +++ b/client/components/Channels.tsx @@ -7,7 +7,9 @@ import Channel from './Channel' import '../assets/css/Channels.css' import { Store } from 'redux' import { - SET_PAGE, storeSetPage, storeShowSettings, storeShowStorage + storeSetPage, + storeShowSettings, + storeShowStorage, } from '../../server/reducers/settingsActions' import ChannelRouteSettings from './ChannelRouteSettings' import ChanStrip from './ChanStrip' @@ -83,9 +85,11 @@ class Channels extends React.Component { handlePages(type: PageType, i: number | string) { if (typeof i === 'string') { - this.props.dispatch(storeSetPage( type, i)) + this.props.dispatch(storeSetPage(type, i)) } else { - this.props.dispatch(storeSetPage(type , i * this.props.settings.pageLength)) + this.props.dispatch( + storeSetPage(type, i * this.props.settings.pageLength) + ) } } diff --git a/server/reducers/settingsActions.ts b/server/reducers/settingsActions.ts index a67800f4..b1344940 100644 --- a/server/reducers/settingsActions.ts +++ b/server/reducers/settingsActions.ts @@ -58,9 +58,19 @@ export const storeSetServerOnline = (serverOnline: boolean) => { } } export const storeSetPage = (pageType: PageType, id: number | string) => { - return { - type: SET_PAGE, - pageType: pageType, - id: id, + if (typeof id === 'string') { + return { + type: SET_PAGE, + pageType: pageType, + id: id, + start: 0, + } + } else { + return { + type: SET_PAGE, + pageType: pageType, + id: '', + start: id, + } } }