Skip to content

Commit db34813

Browse files
chore: apply PR comments
1 parent b23e0a9 commit db34813

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/Instabug.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ export const init = async (config: InstabugConfig) => {
137137
* Handles app state changes and updates APM network flags if necessary.
138138
*/
139139
const handleAppStateChange = async (nextAppState: AppStateStatus, config: InstabugConfig) => {
140-
if (_currentAppState.match(/inactive|background/) && nextAppState === 'active') {
140+
// Checks if the app has come to the foreground
141+
if (['inactive', 'background'].includes(_currentAppState) && nextAppState === 'active') {
141142
// Update the APM network flags
142143
const updatedFlags = await fetchApmNetworkFlags();
143144
const isUpdated = setApmNetworkFlagsIfChanged(updatedFlags);

0 commit comments

Comments
 (0)