Skip to content

Commit 7f28f7b

Browse files
committed
adds useEffect comments and removes print statements
1 parent cb4720c commit 7f28f7b

File tree

2 files changed

+54
-60
lines changed

2 files changed

+54
-60
lines changed

ts/IterableInbox.tsx

+8-9
Original file line numberDiff line numberDiff line change
@@ -116,49 +116,48 @@ const IterableInbox = ({
116116
headline = { ...headline, height: Platform.OS === "android" ? 70 : 60 }
117117
headline = (!isPortrait) ? { ...headline, paddingLeft: 70 } : headline
118118

119+
//fetches inbox messages and adds listener for inbox changes on mount
119120
useEffect(() => {
120121
fetchInboxMessages()
121122
addInboxChangedListener()
122123

124+
//removes listener for inbox changes on unmount and ends inbox session
123125
return () => {
124126
removeInboxChangedListener()
125127
inboxDataModel.endSession(visibleMessageImpressions)
126-
console.log("end session")
127128
}
128129
}, [])
129130

131+
//starts session when user is on inbox and app is active
132+
//ends session when app is in background or app is closed
130133
useEffect(() => {
131134
if(isFocused) {
132135
if(appState === 'active') {
133136
inboxDataModel.startSession(visibleMessageImpressions)
134137
} else if(appState === 'background' && Platform.OS === 'android' || appState === 'inactive') {
135138
inboxDataModel.endSession(visibleMessageImpressions)
136-
console.log("end session")
137139
}
138140
}
139141
}, [appState])
140142

141-
useEffect(() => {
142-
if (isMessageDisplay) {
143-
slideLeft()
144-
}
145-
}, [width])
146-
143+
//starts session when user is on inbox
144+
//ends session when user navigates away from inbox
147145
useEffect(() => {
148146
if(appState === 'active') {
149147
if(isFocused) {
150148
inboxDataModel.startSession(visibleMessageImpressions)
151149
} else {
152150
inboxDataModel.endSession(visibleMessageImpressions)
153-
console.log("end session")
154151
}
155152
}
156153
}, [isFocused])
157154

155+
//updates the visible rows when visible messages changes
158156
useEffect(() => {
159157
inboxDataModel.updateVisibleRows(visibleMessageImpressions)
160158
}, [visibleMessageImpressions])
161159

160+
//if return to inbox trigger is provided, runs the return to inbox animation whenever the trigger is toggled
162161
useEffect(() => {
163162
if(isMessageDisplay) {
164163
returnToInbox()

yarn.lock

+46-51
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,6 @@
214214
dependencies:
215215
"@babel/types" "^7.16.7"
216216

217-
"@babel/helper-module-transforms@^7.15.0":
218-
version "7.15.0"
219-
resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.0.tgz"
220-
integrity sha512-RkGiW5Rer7fpXv9m1B3iHIFDZdItnO2/BLfWVW/9q7+KqQSDY5kUfQEbzdXM1MVhJGcugKV7kRrNVzNxmk7NBg==
221-
dependencies:
222-
"@babel/helper-module-imports" "^7.14.5"
223-
"@babel/helper-replace-supers" "^7.15.0"
224-
"@babel/helper-simple-access" "^7.14.8"
225-
"@babel/helper-split-export-declaration" "^7.14.5"
226-
"@babel/helper-validator-identifier" "^7.14.9"
227-
"@babel/template" "^7.14.5"
228-
"@babel/traverse" "^7.15.0"
229-
"@babel/types" "^7.15.0"
230-
231217
"@babel/helper-module-transforms@^7.17.7":
232218
version "7.17.7"
233219
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd"
@@ -261,6 +247,11 @@
261247
resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz"
262248
integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==
263249

250+
"@babel/helper-plugin-utils@^7.16.7":
251+
version "7.16.7"
252+
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5"
253+
integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==
254+
264255
"@babel/helper-remap-async-to-generator@^7.14.5":
265256
version "7.14.5"
266257
resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz"
@@ -270,7 +261,7 @@
270261
"@babel/helper-wrap-function" "^7.14.5"
271262
"@babel/types" "^7.14.5"
272263

273-
"@babel/helper-replace-supers@^7.14.5", "@babel/helper-replace-supers@^7.15.0":
264+
"@babel/helper-replace-supers@^7.14.5":
274265
version "7.15.0"
275266
resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.0.tgz"
276267
integrity sha512-6O+eWrhx+HEra/uJnifCwhwMd6Bp5+ZfZeJwbqUTuqkhIT6YcRhiZCOOFChRypOIe0cV46kFrRBlm+t5vHCEaA==
@@ -291,13 +282,6 @@
291282
"@babel/traverse" "^7.16.7"
292283
"@babel/types" "^7.16.7"
293284

294-
"@babel/helper-simple-access@^7.14.8":
295-
version "7.14.8"
296-
resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz"
297-
integrity sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==
298-
dependencies:
299-
"@babel/types" "^7.14.8"
300-
301285
"@babel/helper-simple-access@^7.17.7":
302286
version "7.17.7"
303287
resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367"
@@ -847,7 +831,7 @@
847831
debug "^4.1.0"
848832
globals "^11.1.0"
849833

850-
"@babel/types@^7.0.0", "@babel/types@^7.14.5", "@babel/types@^7.14.8", "@babel/types@^7.14.9", "@babel/types@^7.15.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3":
834+
"@babel/types@^7.0.0", "@babel/types@^7.14.5", "@babel/types@^7.14.9", "@babel/types@^7.15.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3":
851835
version "7.15.0"
852836
resolved "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz"
853837
integrity sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ==
@@ -1829,7 +1813,7 @@ array-unique@^0.3.2:
18291813
resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz"
18301814
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
18311815

1832-
array.prototype.flat@^1.2.4:
1816+
array.prototype.flat@^1.2.5:
18331817
version "1.3.0"
18341818
resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b"
18351819
integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==
@@ -2039,10 +2023,10 @@ base@^0.11.1:
20392023
mixin-deep "^1.2.0"
20402024
pascalcase "^0.1.1"
20412025

2042-
big-integer@^1.6.44:
2043-
version "1.6.48"
2044-
resolved "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz"
2045-
integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==
2026+
2027+
version "1.6.51"
2028+
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686"
2029+
integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==
20462030

20472031
bindings@^1.5.0:
20482032
version "1.5.0"
@@ -2209,7 +2193,12 @@ camelcase@^6.0.0:
22092193
resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz"
22102194
integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==
22112195

2212-
caniuse-lite@^1.0.30001251, caniuse-lite@^1.0.30001332:
2196+
caniuse-lite@^1.0.30001317:
2197+
version "1.0.30001335"
2198+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz#899254a0b70579e5a957c32dced79f0727c61f2a"
2199+
integrity sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w==
2200+
2201+
caniuse-lite@^1.0.30001332:
22132202
version "1.0.30001334"
22142203
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001334.tgz#892e9965b35285033fc2b8a8eff499fe02f13d8b"
22152204
integrity sha512-kbaCEBRRVSoeNs74sCuq92MJyGrMtjWVfhltoHUCW4t4pXFvGjUBrfo47weBRViHkiV3eBYyIsfl956NtHGazw==
@@ -2381,7 +2370,7 @@ color-support@^1.1.3:
23812370
resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz"
23822371
integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==
23832372

2384-
colorette@^1.0.7, colorette@^1.3.0:
2373+
colorette@^1.0.7:
23852374
version "1.3.0"
23862375
resolved "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz"
23872376
integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==
@@ -2720,11 +2709,16 @@ [email protected]:
27202709
resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
27212710
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
27222711

2723-
electron-to-chromium@^1.3.811, electron-to-chromium@^1.4.118:
2712+
electron-to-chromium@^1.4.118:
27242713
version "1.4.124"
27252714
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.124.tgz#e9015e234d8632920dcdf5480351da9e845ed220"
27262715
integrity sha512-VhaE9VUYU6d2eIb+4xf83CATD+T+3bTzvxvlADkQE+c2hisiw3sZmvEDtsW704+Zky9WZGhBuQXijDVqSriQLA==
27272716

2717+
electron-to-chromium@^1.4.84:
2718+
version "1.4.129"
2719+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.129.tgz#c675793885721beefff99da50f57c6525c2cd238"
2720+
integrity sha512-GgtN6bsDtHdtXJtlMYZWGB/uOyjZWjmRDumXTas7dGBaB9zUyCjzHet1DY2KhyHN8R0GLbzZWqm4efeddqqyRQ==
2721+
27282722
emittery@^0.7.1:
27292723
version "0.7.2"
27302724
resolved "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz"
@@ -3496,6 +3490,14 @@ get-stream@^5.0.0:
34963490
dependencies:
34973491
pump "^3.0.0"
34983492

3493+
get-symbol-description@^1.0.0:
3494+
version "1.0.0"
3495+
resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6"
3496+
integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==
3497+
dependencies:
3498+
call-bind "^1.0.2"
3499+
get-intrinsic "^1.1.1"
3500+
34993501
get-value@^2.0.3, get-value@^2.0.6:
35003502
version "2.0.6"
35013503
resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz"
@@ -5395,6 +5397,11 @@ minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5:
53955397
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
53965398
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
53975399

5400+
minimist@^1.2.6:
5401+
version "1.2.6"
5402+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
5403+
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
5404+
53985405
mixin-deep@^1.2.0:
53995406
version "1.3.2"
54005407
resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz"
@@ -5517,12 +5524,7 @@ node-notifier@^8.0.0:
55175524
uuid "^8.3.0"
55185525
which "^2.0.2"
55195526

5520-
node-releases@^1.1.75:
5521-
version "1.1.77"
5522-
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e"
5523-
integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==
5524-
5525-
node-releases@^2.0.3:
5527+
node-releases@^2.0.2, node-releases@^2.0.3:
55265528
version "2.0.4"
55275529
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476"
55285530
integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ==
@@ -5891,9 +5893,9 @@ path-key@^3.0.0, path-key@^3.1.0:
58915893
resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz"
58925894
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
58935895

5894-
path-parse@^1.0.6:
5896+
path-parse@^1.0.6, path-parse@^1.0.7:
58955897
version "1.0.7"
5896-
resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz"
5898+
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
58975899
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
58985900

58995901
picocolors@^1.0.0:
@@ -5918,13 +5920,6 @@ pirates@^4.0.0, pirates@^4.0.1:
59185920
dependencies:
59195921
node-modules-regexp "^1.0.0"
59205922

5921-
pkg-dir@^2.0.0:
5922-
version "2.0.0"
5923-
resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz"
5924-
integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=
5925-
dependencies:
5926-
find-up "^2.1.0"
5927-
59285923
pkg-dir@^3.0.0:
59295924
version "3.0.0"
59305925
resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz"
@@ -6958,6 +6953,11 @@ supports-hyperlinks@^2.0.0:
69586953
has-flag "^4.0.0"
69596954
supports-color "^7.0.0"
69606955

6956+
supports-preserve-symlinks-flag@^1.0.0:
6957+
version "1.0.0"
6958+
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
6959+
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
6960+
69616961
symbol-tree@^3.2.4:
69626962
version "3.2.4"
69636963
resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz"
@@ -7532,11 +7532,6 @@ xmldoc@^1.1.2:
75327532
dependencies:
75337533
sax "^1.2.1"
75347534

7535-
xmldom@^0.6.0:
7536-
version "0.6.0"
7537-
resolved "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz"
7538-
integrity sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==
7539-
75407535
xpipe@^1.0.5:
75417536
version "1.0.5"
75427537
resolved "https://registry.npmjs.org/xpipe/-/xpipe-1.0.5.tgz"

0 commit comments

Comments
 (0)