Skip to content

Commit

Permalink
status fix (#870)
Browse files Browse the repository at this point in the history
Co-authored-by: Ash <[email protected]>
  • Loading branch information
ashleyjtaylor and Ash authored Oct 24, 2024
1 parent 5dc9431 commit 2f8ce39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/src/js/components/latest-levels-auto-refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ class LatestLevelsAutoRefresh {
if (currentItem) {
const currentTime = currentItem.querySelector('[data-item-time]')
const currentValue = currentItem.querySelector('[data-item-value]')
const currentStatus = currentItem.getAttribute('data-item-status')

if (fetchedStatus === currentStatus) {
// if isSuspendedOrOffline
if (fetchedStatus === 'false') {
if (fetchedValue?.textContent !== currentValue?.textContent) {
clearInterval(this.timeAgoInterval)

Expand Down
2 changes: 1 addition & 1 deletion server/views/partials/latest-levels.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="defra-live">
<h2 class="defra-live__title">Latest level{% if model.latestLevels.length > 1 %}s{% endif %}</h2>
{% for warnings in model.latestLevels %}
<div class="defra-live__item" data-item-status="{{ warnings.status }}" data-item-name="{{ warnings.river_name }}" data-item-agency="{{ warnings.agency_name }}" data-item-id="{{ warnings.rloi_id }}{% if warnings.direction == 'd' %}/downstream{% endif %}">
<div class="defra-live__item" data-item-status="{{ warnings.isSuspendedOrOffline }}" data-item-name="{{ warnings.river_name }}" data-item-agency="{{ warnings.agency_name }}" data-item-id="{{ warnings.rloi_id }}{% if warnings.direction == 'd' %}-downstage{% endif %}">
{% if warnings.status == 'Suspended' or (warnings.status == 'Active' and warnings.latest_level == null) %}
<p class="defra-flood-meta defra-flood-meta--no-border govuk-!-margin-bottom-0">
<strong>Latest Level</strong>
Expand Down

0 comments on commit 2f8ce39

Please sign in to comment.