-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationArchivePage.js
More file actions
37 lines (31 loc) · 1.19 KB
/
NotificationArchivePage.js
File metadata and controls
37 lines (31 loc) · 1.19 KB
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
const Observable = require('FuseJS/Observable');
var DailyNotifications = require("DailyNotifications");
var Model = require('UserData');
var UserTimeObservables = require("UserTimeObservables.js");
var passedSmokeNotifs = Observable();
var passedSnusNotifs = Observable();
var showSmoke = Observable();
var showSnus = Observable();
const onActivated = function() {
passedSmokeNotifs.replaceAll(DailyNotifications.pastSmokeNotifications());
passedSnusNotifs.replaceAll(DailyNotifications.pastSnusNotifications());
showSmoke.value = (Model.getUserData()["smokes"].value && UserTimeObservables.durationSmokeFreeMs.value > 0);
showSnus.value = (Model.getUserData()["snus"].value && UserTimeObservables.durationSnusFreeMs.value > 0);
};
const currentPage = Observable();
const smokeTapped = function() {
currentPage.value = "archiveTabRoyk";
};
const snusTapped = function() {
currentPage.value = "archiveTabSnus";
};
module.exports = {
currentPage: currentPage,
passedSmokeNotifs: passedSmokeNotifs,
passedSnusNotifs: passedSnusNotifs,
onActivated: onActivated,
smokeTapped: smokeTapped,
snusTapped: snusTapped,
showSmoke: showSmoke,
showSnus: showSnus
};