Skip to content

Commit 6db5bb9

Browse files
chrisbobbegnprice
authored andcommitted
ServerPushSetupBanner [nfc]: Remove now-unused isDismissable prop
1 parent 8981a37 commit 6db5bb9

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

src/common/ServerPushSetupBanner.js

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,18 @@ import { openLinkWithUserPreference } from '../utils/openLink';
1313
import { getOwnUserRole, roleIsAtLeast } from '../permissionSelectors';
1414
import { Role } from '../api/permissionsTypes';
1515

16-
type Props = $ReadOnly<{|
17-
isDismissable?: boolean,
18-
|}>;
16+
type Props = $ReadOnly<{||}>;
1917

2018
/**
2119
* A "nag banner" saying the server hasn't enabled push notifications, if so
2220
*
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.)
3126
*/
3227
export default function ServerPushSetupBanner(props: Props): Node {
33-
const { isDismissable = true } = props;
34-
3528
const dispatch = useDispatch();
3629

3730
const lastDismissedServerPushSetupNotice = useSelector(
@@ -47,8 +40,7 @@ export default function ServerPushSetupBanner(props: Props): Node {
4740
if (pushNotificationsEnabled) {
4841
// don't show
4942
} else if (
50-
isDismissable
51-
&& lastDismissedServerPushSetupNotice !== null
43+
lastDismissedServerPushSetupNotice !== null
5244
// TODO: Could rerender this component on an interval, to give an
5345
// upper bound on how outdated this `new Date()` can be.
5446
&& lastDismissedServerPushSetupNotice >= subWeeks(new Date(), 2)
@@ -68,15 +60,13 @@ export default function ServerPushSetupBanner(props: Props): Node {
6860
}
6961

7062
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+
});
8070
buttons.push({
8171
id: 'learn-more',
8272
label: 'Learn more',

0 commit comments

Comments
 (0)