resonatecoop / stream

Monorepo for Resonate Coop player
https://stream.resonate.coop
GNU General Public License v3.0
171 stars 24 forks source link

fix: check for navigator without undefined #255

Closed peterklingelhofer closed 2 years ago

peterklingelhofer commented 2 years ago

This should work based on this answer.

Should solve this error:

◇ ReferenceError: navigator is not defined
    at Track.renderMenuButtonOptions (/var/www/app/packages/track-component/index.js:159:17)
    at Track.createElement (/var/www/app/packages/track-component/index.js:74:41)
    at Track.Nanocomponent.render (/var/www/app/node_modules/nanocomponent/index.js:53:29)
    at TrackDetails.createElement (/var/www/app/beta/build/components/track-details/index.js:25:87)
    at TrackDetails.Nanocomponent.render (/var/www/app/node_modules/nanocomponent/index.js:53:29)
    at renderTrack (/var/www/app/beta/build/views/track/index.js:11:71)
    at /var/www/app/beta/build/layouts/default/index.js:20:13
    at Choo._handler (/var/www/app/beta/build/elements/layout.js:25:17)
    at Choo._prerender (/var/www/app/node_modules/choo/index.js:259:18)
    at Choo.toString (/var/www/app/node_modules/choo/index.js:232:19)
auggod commented 2 years ago

Cool! In the future we should probably turn this function into a module inside packages/

peterklingelhofer commented 2 years ago

Cool! In the future we should probably turn this function into a module inside packages/

I was originally trying to make this a function in helpers but it kept saying undefined and isIOS is not a function on import attempts and figured we should just get this fix online quickly first. That's a good idea making a package for it.

auggod commented 2 years ago

Seems standard is complaining

peterklingelhofer commented 2 years ago

@auggod npm test stopped working for me on this repo for some reason, it throws on all of the packages for me, so that's why I had to keep pushing to this to test. Should be good to go now.