Skip to content

Commit

Permalink
To not set 'to' when setting TimeRange to 'All Time' (#11017)
Browse files Browse the repository at this point in the history
## Motivation
Prior to this change, the backend raised an error if a user switch the
timerange from 'from -> to' to 'All time' since 'to' was still send to
the server, which the server refuesed to accept.

## Description
This change will change the check where the submitted timerange is
checked to be 'All Time'
Before we did not see the timerange as 'All Time' if 'to' was still set,
but to would have been unset AFTER it acknowleged the time range a s
'All Time'.
  • Loading branch information
kmerz committed Jul 15, 2021
1 parent 8770db1 commit 6e8c0f6
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -20,7 +20,7 @@ import { isTypeRelativeWithEnd, isTypeRelativeWithStartOnly } from 'views/typeGu
import { TimeRange } from 'views/logic/queries/Query';

const isAllMessagesRange = (timeRange: TimeRange) => {
return (isTypeRelativeWithEnd(timeRange) && timeRange.from === RELATIVE_ALL_TIME && !timeRange.to) || (isTypeRelativeWithStartOnly(timeRange) && timeRange.range === RELATIVE_ALL_TIME);
return (isTypeRelativeWithEnd(timeRange) && timeRange.from === RELATIVE_ALL_TIME) || (isTypeRelativeWithStartOnly(timeRange) && timeRange.range === RELATIVE_ALL_TIME);
};

export default isAllMessagesRange;

0 comments on commit 6e8c0f6

Please sign in to comment.