Skip to content

Commit

Permalink
Try to fix document.querySelectorAll(.safe-padding).forEach is not a …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
swrobel committed Feb 15, 2022
1 parent 24de1f6 commit f43fa45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/packs/application.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require.context('../images', true)
<% end %>

function setSafePadding() {
document.querySelectorAll('.safe-padding').forEach(node => {
document.querySelectorAll('.safe-padding')?.forEach(node => {
if (window.orientation == 90) { // notch is on the left
node.classList.add('safe-padding-left')
node.classList.remove('safe-padding-right')
Expand Down

0 comments on commit f43fa45

Please sign in to comment.