Rework how the onboarding notifications task works (#12839)
* Rework how the onboarding notifications task works Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
dd20741b87
commit
02047243f0
6 changed files with 85 additions and 17 deletions
|
@ -136,14 +136,18 @@ const tasks: UserOnboardingTask[] = [
|
|||
id: "permission-notifications",
|
||||
title: _t("onboarding|enable_notifications"),
|
||||
description: _t("onboarding|enable_notifications_description"),
|
||||
completed: (ctx: UserOnboardingContext) => ctx.hasNotificationsEnabled,
|
||||
completed: (ctx: UserOnboardingContext) => !ctx.showNotificationsPrompt,
|
||||
action: {
|
||||
label: _t("onboarding|enable_notifications_action"),
|
||||
onClick: (ev: ButtonEvent) => {
|
||||
PosthogTrackers.trackInteraction("WebUserOnboardingTaskEnableNotifications", ev);
|
||||
Notifier.setEnabled(true);
|
||||
defaultDispatcher.dispatch({
|
||||
action: Action.ViewUserSettings,
|
||||
initialTabId: UserTab.Notifications,
|
||||
});
|
||||
Notifier.setPromptHidden(true);
|
||||
},
|
||||
hideOnComplete: true,
|
||||
hideOnComplete: !Notifier.isPossible(),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue