Bug 1736811 - Compare View error: Cannot read property 'value' of undefined (#7300)

* Bug 1736811 - Compare View error: Cannot read property 'value' of undefined

* Addres PR changes

* Address PR changes

* Address PR changes
This commit is contained in:
Sorin Toma 2021-10-27 14:07:46 +03:00 коммит произвёл GitHub
Родитель bf87a56cfb
Коммит 6e696411e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -19,7 +19,9 @@ class CompareView extends React.PureComponent {
let timeRange = Math.min(oldTimestamp, newTimestamp);
timeRange = Math.round(now - timeRange);
const newTimeRange = phTimeRanges.find((time) => timeRange <= time.value);
return newTimeRange.value;
// data from repository mozilla-inbound it's older than one year, making newTimeRange become undefined and causing an inifite loading loop
// this is a temporary solution until mozilla-inbound data will be removed from Perfherder UI
return newTimeRange !== undefined ? newTimeRange.value : -1;
};
queryParams = (repository, interval, framework) => ({