Skip to content

Commit c6879bf

Browse files
committed
add comment about not resetting OneSignal tags to refresh.js
1 parent adcde81 commit c6879bf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

source/lib/refresh.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,24 @@ import {clearLoginCredentials} from './login'
55
import * as icons from '@hawkrives/react-native-alternate-icons'
66

77
export async function refreshApp() {
8+
// This purposefully does not reset the OneSignal subscription tags,
9+
// because OneSignals' deleteTags method requires a list of tags. This
10+
// would require that we call getTags before deleting them, which
11+
// introduces a network request into this procedure. I would rather avoid
12+
// network requests in here, _especially_ network requests which have
13+
// shown themselves to not always return in a timely fashion.
14+
15+
// Clear AsyncStorage
816
await clearAsyncStorage()
17+
18+
// Clear the Keychain items
919
await clearLoginCredentials()
20+
21+
// Reset the app icon
1022
if ((await icons.getIconName()) !== 'default') {
1123
await icons.reset()
1224
}
25+
26+
// Restart the app
1327
restart.Restart()
1428
}

0 commit comments

Comments
 (0)