Skip to content

Commit

Permalink
Merge pull request #1653 from memphisdev/bugfix-RND-488-get-station-o…
Browse files Browse the repository at this point in the history
…verview-for-old-station

get-station-overview-for-old-station
  • Loading branch information
SvetaMemphis authored Jan 25, 2024
2 parents 8462410 + 4869327 commit 62c7432
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ui_src/src/domain/stationOverview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { StringCodec, JSONCodec } from 'nats.ws';
const initializeState = {
stationMetaData: { is_native: true },
stationSocketData: {},
stationPartition: 1,
stationPartition: null,
stationFunctions: {}
};
let sub;
Expand Down Expand Up @@ -63,9 +63,9 @@ const StationOverview = () => {
const getStaionMetaData = async () => {
try {
let data = await httpRequest('GET', `${ApiEndpoints.GET_STATION}?station_name=${stationName}`);

data.created_at = await parsingDate(data.created_at);
stationDispatch({ type: 'SET_STATION_META_DATA', payload: data });
stationDispatch({ type: 'SET_STATION_PARTITION', payload: data?.partitions_list ? 1 : -1 });
} catch (error) {
if (error.status === 404) {
history.push(pathDomains.stations);
Expand Down Expand Up @@ -95,8 +95,9 @@ const StationOverview = () => {
// if (socketOn) {
// getStationDetails();
// }
getStationDetails();
}, [stationState?.stationPartition || stationState?.stationSocketData?.total_messages || stationState?.stationSocketData?.total_dls_messages, stationName]);
// getStationDetails();
stationState?.stationPartition && getStationDetails();
}, [stationState?.stationPartition]);

// const startListen = async () => {
// const jc = JSONCodec();
Expand Down Expand Up @@ -164,8 +165,6 @@ const StationOverview = () => {
setisLoading(true);
dispatch({ type: 'SET_ROUTE', payload: 'stations' });
getStaionMetaData();
getStationDetails();
stationDispatch({ type: 'SET_STATION_PARTITION', payload: 1 });
}, [stationName]);

return (
Expand Down

0 comments on commit 62c7432

Please sign in to comment.