-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-2382]chore:notification snooze modal #6164
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
web/core/components/workspace-notifications/sidebar/notification-card/options/snooze/modal.tsx
(1 hunks)web/core/components/workspace-notifications/sidebar/notification-card/options/snooze/root.tsx
(1 hunks)web/core/store/notifications/workspace-notifications.store.ts
(1 hunks)
🔇 Additional comments (2)
web/core/components/workspace-notifications/sidebar/notification-card/options/snooze/modal.tsx (1)
20-20
: LGTM! Type signature simplification
The change to return Promise is a good simplification as the notification update is handled through the store, and the return value wasn't being used.
web/core/store/notifications/workspace-notifications.store.ts (1)
87-87
: LGTM! Enhanced extensibility
Changing the store parameter from private to protected is a good improvement that enables better extensibility through inheritance while maintaining proper encapsulation.
@@ -34,25 +34,23 @@ export const NotificationItemSnoozeOption: FC<TNotificationItemSnoozeOption> = o | |||
const handleNotificationSnoozeDate = async (snoozeTill: Date | undefined) => { | |||
if (snoozeTill) { | |||
try { | |||
const response = await snoozeNotification(workspaceSlug, snoozeTill); | |||
snoozeNotification(workspaceSlug, snoozeTill); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inconsistent async/await usage
The async handling is inconsistent between snooze and unsnooze operations. Line 37 doesn't await the snoozeNotification call while line 48 awaits unSnoozeNotification. This could lead to misleading success messages if the operation fails.
Apply this fix to ensure consistent async handling:
-snoozeNotification(workspaceSlug, snoozeTill);
+await snoozeNotification(workspaceSlug, snoozeTill);
Also applies to: 48-48
Summary
Modified types for snooze modal functions.
Reference
WEB-2382
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores
NotificationsSidebar
export to streamline the codebase.