11import React from "react" ;
2+ import { isAppHosted as getIsAppHosted } from "./appHosted/AppHostedUtils" ;
23
34const windows = navigator . appVersion . indexOf ( "Win" ) >= 0 ;
45const android = navigator . appVersion . indexOf ( "Android" ) >= 0 ;
@@ -10,9 +11,13 @@ const linux =
1011 navigator . platform ?. startsWith ( "Linux" ) ) &&
1112 ! android &&
1213 ! chromeOS ;
14+
15+ const isAppHosted = getIsAppHosted ( ) ;
16+
1317export const bloomDesktopAvailable = windows || linux ;
1418
15- export const bloomReaderAvailable = android ;
19+ // Assumption: app-hosted also provides a reading experience for the books
20+ export const bloomReaderAvailable = android || isAppHosted ;
1621// From discussion at https://stackoverflow.com/questions/9038625/detect-if-device-is-ios.
1722// This will NOT detect an ipad running IOS 13 in desktop mode, which is probably what we
1823// want, since the current application is hiding the bloomd download on non-desktop devices
@@ -31,7 +36,8 @@ const testingMobileIos = /\((iPhone|iPad|iPod)/.test(navigator.userAgent);
3136// that important to do so on every possible mobile device. Of course, we REALLY
3237// don't want to prevent downloading a bloomd on anything that can run BloomReader,
3338// but cantUseBloomD is currently only relevant if bloomReaderAvailable is false.
34- export const cantUseBloomD = ios || testingMobileIos ;
39+ // Assumption: app-hosted can use BloomD files
40+ export const cantUseBloomD = ( ios || testingMobileIos ) && ! isAppHosted ;
3541// We hide disabled download buttons on mobile (touch) devices because it not
3642// easily discoverable why a button is disabled.
3743export const mobile = android || ios || testingMobileIos ;
0 commit comments