Skip to content

Commit dd619c2

Browse files
committed
Allow bloompub downloads in app-hosted mode
1 parent 1c4a6bf commit dd619c2

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/components/OSFeaturesContext.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import { isAppHosted as getIsAppHosted } from "./appHosted/AppHostedUtils";
23

34
const windows = navigator.appVersion.indexOf("Win") >= 0;
45
const 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+
1317
export 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.
3743
export const mobile = android || ios || testingMobileIos;

0 commit comments

Comments
 (0)