@@ -13,25 +13,18 @@ import { openLinkWithUserPreference } from '../utils/openLink';
13
13
import { getOwnUserRole , roleIsAtLeast } from '../permissionSelectors' ;
14
14
import { Role } from '../api/permissionsTypes' ;
15
15
16
- type Props = $ReadOnly < { |
17
- isDismissable ?: boolean ,
18
- | } > ;
16
+ type Props = $ReadOnly < { || } > ;
19
17
20
18
/**
21
19
* A "nag banner" saying the server hasn't enabled push notifications, if so
22
20
*
23
- * If `isDismissable` is false, the banner is always visible unless the
24
- * server is set up for push notifications.
25
- *
26
- * Otherwise, it offers a dismiss button. If this notice is dismissed, it
27
- * sleeps for two weeks, then reappears if the server hasn't gotten set up
28
- * for push notifications in that time. ("This notice" means the currently
29
- * applicable notice. If the server does get setup for push notifications,
30
- * then gets un-setup, a new notice will apply.)
21
+ * Offers a dismiss button. If this notice is dismissed, it sleeps for two
22
+ * weeks, then reappears if the server hasn't gotten set up for push
23
+ * notifications in that time. ("This notice" means the currently applicable
24
+ * notice. If the server does get setup for push notifications, then gets
25
+ * un-setup, a new notice will apply.)
31
26
*/
32
27
export default function ServerPushSetupBanner ( props : Props ) : Node {
33
- const { isDismissable = true } = props ;
34
-
35
28
const dispatch = useDispatch ( ) ;
36
29
37
30
const lastDismissedServerPushSetupNotice = useSelector (
@@ -47,8 +40,7 @@ export default function ServerPushSetupBanner(props: Props): Node {
47
40
if ( pushNotificationsEnabled ) {
48
41
// don't show
49
42
} else if (
50
- isDismissable
51
- && lastDismissedServerPushSetupNotice !== null
43
+ lastDismissedServerPushSetupNotice !== null
52
44
// TODO: Could rerender this component on an interval, to give an
53
45
// upper bound on how outdated this `new Date()` can be.
54
46
&& lastDismissedServerPushSetupNotice >= subWeeks ( new Date ( ) , 2 )
@@ -68,15 +60,13 @@ export default function ServerPushSetupBanner(props: Props): Node {
68
60
}
69
61
70
62
const buttons = [ ] ;
71
- if ( isDismissable ) {
72
- buttons . push ( {
73
- id : 'dismiss' ,
74
- label : 'Remind me later' ,
75
- onPress : ( ) => {
76
- dispatch ( dismissServerPushSetupNotice ( ) ) ;
77
- } ,
78
- } ) ;
79
- }
63
+ buttons . push ( {
64
+ id : 'dismiss' ,
65
+ label : 'Remind me later' ,
66
+ onPress : ( ) => {
67
+ dispatch ( dismissServerPushSetupNotice ( ) ) ;
68
+ } ,
69
+ } ) ;
80
70
buttons . push ( {
81
71
id : 'learn-more' ,
82
72
label : 'Learn more' ,
0 commit comments