aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/delayApp/index.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-07 15:50:23 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-07 15:50:23 +0200
commite7a74514c1e7c3833dfdcf5900cb87f9e6e8354e (patch)
treeb8314e4155503b135dcb07e8b4a0e847e25c19cf /src/features/delayApp/index.js
parentUpdate CHANGELOG.md (diff)
parentUpdate CHANGELOG.md (diff)
downloadferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.gz
ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.zst
ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.zip
Merge branch 'master' of https://github.com/meetfranz/franz into franz-5.3.0
Diffstat (limited to 'src/features/delayApp/index.js')
-rw-r--r--src/features/delayApp/index.js10
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 {