Skip to content

Commit

Permalink
Bugfix render options (minmatarfleet#433)
Browse files Browse the repository at this point in the history
* Bugfix reading boolean local variables

* Added default option value when not initializated
  • Loading branch information
beautifulmim authored Jun 3, 2024
1 parent 762faa0 commit 3d6a093
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/app/src/pages/ships/fitting/[fitting_id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const normal_view = translatePath(`/ships/fitting/normal/${id}`)
---

<script define:vars={{ render_view, normal_view }}>
const render_enabled = JSON.parse(localStorage.getItem('_x_render_enabled'))
const render_enabled = JSON.parse(localStorage.getItem('_x_render_enabled') ?? 'true')

if (window.innerWidth > 1820 && render_enabled === true)
window.location.href = render_view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const page_title = fitting.name
---

<script define:vars={{ render_view }}>
const render_enabled = JSON.parse(localStorage.getItem('_x_render_enabled'))
const render_enabled = JSON.parse(localStorage.getItem('_x_render_enabled') ?? 'true')

if (window.innerWidth > 1820 && render_enabled === true)
window.location.href = render_view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const page_title = fitting_parsed.name;
---

<script define:vars={{ normal_view }}>
const render_enabled = JSON.parse(localStorage.getItem('_x_render_enabled'))
const render_enabled = JSON.parse(localStorage.getItem('_x_render_enabled') ?? 'true')

if (window.innerWidth < 1820 || render_enabled === false)
window.location.href = normal_view
Expand Down

0 comments on commit 3d6a093

Please sign in to comment.