-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathreact-native-notifier+1.6.1.patch
More file actions
49 lines (46 loc) · 2.06 KB
/
Copy pathreact-native-notifier+1.6.1.patch
File metadata and controls
49 lines (46 loc) · 2.06 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
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/node_modules/react-native-notifier/src/Notifier.tsx b/node_modules/react-native-notifier/src/Notifier.tsx
index 56c5819..4f31e78 100644
--- a/node_modules/react-native-notifier/src/Notifier.tsx
+++ b/node_modules/react-native-notifier/src/Notifier.tsx
@@ -44,6 +44,7 @@ export class NotifierRoot extends React.PureComponent<ShowNotificationParams, St
Component: NotificationComponent,
swipeEnabled: DEFAULT_SWIPE_ENABLED,
componentProps: {},
+ visible: false,
};
this.isShown = false;
this.isHiding = false;
@@ -146,6 +147,7 @@ export class NotifierRoot extends React.PureComponent<ShowNotificationParams, St
Component: Component ?? NotificationComponent,
swipeEnabled: swipeEnabled ?? DEFAULT_SWIPE_ENABLED,
componentProps: componentProps,
+ visible: true,
});
this.showParams = restParams;
@@ -188,6 +190,7 @@ export class NotifierRoot extends React.PureComponent<ShowNotificationParams, St
}
private onHidden() {
+ this.setState({ visible: false })
this.showParams?.onHidden?.();
this.isShown = false;
this.isHiding = false;
@@ -259,7 +262,7 @@ export class NotifierRoot extends React.PureComponent<ShowNotificationParams, St
>
<TouchableWithoutFeedback onPress={this.onPress}>
<View onLayout={this.onLayout}>
- <Component title={title} description={description} {...componentProps} />
+ {this.state.visible? <Component title={title} description={description} {...componentProps} /> : null}
</View>
</TouchableWithoutFeedback>
</Animated.View>
diff --git a/node_modules/react-native-notifier/src/types.ts b/node_modules/react-native-notifier/src/types.ts
index 229e19c..e16a943 100644
--- a/node_modules/react-native-notifier/src/types.ts
+++ b/node_modules/react-native-notifier/src/types.ts
@@ -95,6 +95,7 @@ export interface StateInterface {
swipeEnabled: boolean;
Component: ElementType;
componentProps: Record<string, any>;
+ visible: boolean;
}
export interface NotifierInterface {