Skip to content

Commit

Permalink
Fix console warnings & compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
swrobel committed Aug 18, 2023
1 parent 0d49027 commit 7158079
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/javascript/components/BuoyChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Bugsnag from '@bugsnag/js'

const BuoyChart = props => {
const options = {
accessibility: {
enabled: false,
},
chart: {
marginRight: 2,
spacingLeft: 0,
Expand Down Expand Up @@ -58,7 +61,7 @@ const BuoyChart = props => {
},
},
}
const ErrorBoundary = Bugsnag.getPlugin('react')?.createErrorBoundary(React) || React.Fragment
const ErrorBoundary = Bugsnag.client ? Bugsnag.getPlugin('react')?.createErrorBoundary(React) : React.Fragment

return(
<ErrorBoundary>
Expand Down
5 changes: 4 additions & 1 deletion app/javascript/components/SpotChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Bugsnag from '@bugsnag/js'

const SpotChart = props => {
const options = {
accessibility: {
enabled: false,
},
chart: {
marginRight: 2,
spacingLeft: 0,
Expand Down Expand Up @@ -89,7 +92,7 @@ const SpotChart = props => {
},
},
}
const ErrorBoundary = Bugsnag.getPlugin('react')?.createErrorBoundary(React) || React.Fragment
const ErrorBoundary = Bugsnag.client ? Bugsnag.getPlugin('react')?.createErrorBoundary(React) : React.Fragment

return(
<ErrorBoundary>
Expand Down
4 changes: 2 additions & 2 deletions app/views/regions/buoys.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
- to && reports.dig(to + 1, :timestamp)&.hour == 23 && to += 1
= react_component 'BuoyChart', {\
data: [\
{ name: 'Swell waves', color: '#C3874B', marker: {symbol: "url(#{asset_pack_path('static/swell-marker.svg')})"}, data: reports.collect { |point| { y: point[:swell_wave_height], swell: point[:ground_swell_height], period: point[:ground_swell_period], direction: point[:ground_swell_direction], tooltip_time: point[:tooltip_time], className: "dir-#{point[:ground_swell_direction].round}" } } },
{ name: 'Wind waves', color: '#4799E6', marker: {symbol: "url(#{asset_pack_path('static/wind-marker.svg')})"}, data: reports.collect { |point| { y: point[:wind_wave_height], swell: point[:wind_swell_height], period: point[:wind_swell_period], direction: point[:wind_swell_direction], className: "dir-#{point[:wind_swell_direction].round}" } } },
{ name: 'Swell waves', color: '#C3874B', marker: {symbol: "url(#{asset_pack_path('static/images/swell-marker.svg')})"}, data: reports.collect { |point| { y: point[:swell_wave_height], swell: point[:ground_swell_height], period: point[:ground_swell_period], direction: point[:ground_swell_direction], tooltip_time: point[:tooltip_time], className: "dir-#{point[:ground_swell_direction].round}" } } },
{ name: 'Wind waves', color: '#4799E6', marker: {symbol: "url(#{asset_pack_path('static/images/wind-marker.svg')})"}, data: reports.collect { |point| { y: point[:wind_wave_height], swell: point[:wind_swell_height], period: point[:wind_swell_period], direction: point[:wind_swell_direction], className: "dir-#{point[:wind_swell_direction].round}" } } },
],
max: @max,
plotBands: to && [{\
Expand Down

0 comments on commit 7158079

Please sign in to comment.