diff options
Diffstat (limited to 'src/features/delayApp/index.js')
-rw-r--r-- | src/features/delayApp/index.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js index c753eeffe..4f793f16c 100644 --- a/src/features/delayApp/index.js +++ b/src/features/delayApp/index.js | |||
@@ -43,14 +43,16 @@ export default function init(stores) { | |||
43 | config.delayDuration = globalConfig.wait !== undefined ? globalConfig.wait : DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.wait; | 43 | config.delayDuration = globalConfig.wait !== undefined ? globalConfig.wait : DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.wait; |
44 | 44 | ||
45 | autorun(() => { | 45 | autorun(() => { |
46 | if (stores.services.all.length === 0) { | 46 | const { isAnnouncementShown } = stores.announcements; |
47 | debug('seas', stores.services.all.length); | 47 | if (stores.services.allDisplayed.length === 0 || isAnnouncementShown) { |
48 | shownAfterLaunch = true; | 48 | shownAfterLaunch = true; |
49 | setVisibility(false); | ||
49 | return; | 50 | return; |
50 | } | 51 | } |
51 | 52 | ||
52 | const diff = moment().diff(timeLastDelay); | 53 | const diff = moment().diff(timeLastDelay); |
53 | if ((stores.app.isFocused && diff >= config.delayOffset) || !shownAfterLaunch) { | 54 | const itsTimeToWait = diff >= config.delayOffset; |
55 | if (!isAnnouncementShown && ((stores.app.isFocused && itsTimeToWait) || !shownAfterLaunch)) { | ||
54 | debug(`App will be delayed for ${config.delayDuration / 1000}s`); | 56 | debug(`App will be delayed for ${config.delayDuration / 1000}s`); |
55 | 57 | ||
56 | setVisibility(true); | 58 | setVisibility(true); |
@@ -63,6 +65,8 @@ export default function init(stores) { | |||
63 | 65 | ||
64 | setVisibility(false); | 66 | setVisibility(false); |
65 | }, config.delayDuration + 1000); // timer needs to be able to hit 0 | 67 | }, config.delayDuration + 1000); // timer needs to be able to hit 0 |
68 | } else { | ||
69 | setVisibility(false); | ||
66 | } | 70 | } |
67 | }); | 71 | }); |
68 | } else { | 72 | } else { |