blob: 04e3684aeaa150d74a3bd803dd66e0a35052d07c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
import { observable, reaction } from 'mobx';
import ms from 'ms';
import { state as delayAppState } from '../delayApp';
import { planSelectionStore } from '../planSelection';
export { default as Component } from './Component';
const debug = require('debug')('Ferdi:feature:shareFranz');
const defaultState = {
isModalVisible: false,
lastShown: null,
};
export const state = observable(defaultState);
export default function initialize(stores) {
debug('Initialize shareFerdi feature');
window.ferdi.features.shareFerdi = {
state,
};
function showModal() {
debug('Would have showed share window');
// state.isModalVisible = true;
}
reaction(
() => stores.user.isLoggedIn,
() => {
setTimeout(() => {
if (stores.settings.stats.appStarts % 50 === 0 && !planSelectionStore.showPlanSelectionOverlay) {
if (delayAppState.isDelayAppScreenVisible) {
debug('Delaying share modal by 5 minutes');
setTimeout(() => showModal(), ms('5m'));
} else {
showModal();
}
}
}, ms('2s'));
},
{
fireImmediately: true,
},
);
}
|