fixed some errors

This commit is contained in:
Luke Berndt
2023-07-18 20:48:09 -04:00
parent 2903fe9d03
commit 4ceb65cc02
4 changed files with 17 additions and 14 deletions

View File

@@ -265,6 +265,7 @@ function Calls(props) {
filterTalkgroups: [],
filterGroupId: false,
filterStarred: false,
filterCallId: false,
shortName: shortName
};
@@ -288,6 +289,7 @@ function Calls(props) {
if (uri.hasOwnProperty('call-id')) {
const _id = uri['call-id'];
setInitialCallId(_id);
filter.filterCallId = false;
setAutoPlay(false);
setLive(false);
if (!urlOptions) setUrlOptions(true);

View File

@@ -12,6 +12,7 @@ const initialState = {
filterGroupId: false,
filterDate: false,
filterStarred: false,
filterCallId: false,
currentCallId: false,
playlist: [],
live: false,
@@ -36,6 +37,9 @@ export const callPlayerSlice = createSlice({
setCurrentCallId: (state, action) => {
state.currentCallId = action.payload;
},
setFilterCallId: (state, action) => {
state.filterCallId = action.payload;
},
setCallTime: (state, action) => {
state.newestCallTime = action.payload;
state.oldestCallTime = action.payload;
@@ -70,6 +74,7 @@ export const callPlayerSlice = createSlice({
state.filterTalkgroups = !action.payload.filterTalkgroups ? [] : action.payload.filterTalkgroups;
state.filterGroupId = !action.payload.filterGroupId ? false : action.payload.filterGroupId;
state.filterDate = !action.payload.filterDate ? 0 : action.payload.filterDate;
state.filterCallId = !action.payload.filterCallId ? false : action.payload.filterCallId;
state.shortName = !action.payload.shortName ? state.shortName : action.payload.shortName;
},
setLive: (state,action) => {

View File

@@ -78,17 +78,19 @@ const initialState = {
var params = {};
var url = "";
const {shortName,filterType,filterGroupId, filterTalkgroups, filterStarred, filterDate} = getState().callPlayer;
const {shortName,filterType,filterGroupId, filterTalkgroups, filterStarred, filterDate, filterCallId} = getState().callPlayer;
if ((typeof direction === 'string') && (typeof date === 'number')) {
url = url + '/' + direction;
params["time"] = date;
} else {
if (filterDate){
url = url + '/date'
} else if (filterCallId) {
url = url + '/date'
params["time"] = filterDate;
} else if (filterDate){
url = url + '/'
params["time"] = filterDate;
}
}
if (filterStarred) {
params["filter-starred"] = true;
}