Skip to content

Commit

Permalink
refactor: use optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Prithpal-Sooriya committed Jul 18, 2024
1 parent e9effc9 commit 57e2089
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const fetchFeatureAnnouncementNotifications = async (
export async function getFeatureAnnouncementNotifications(
env: Env,
): Promise<INotification[]> {
if (env && env.accessToken && env.spaceId && env.platform) {
if (env?.accessToken && env?.spaceId && env?.platform) {
const rawNotifications = await fetchFeatureAnnouncementNotifications(env);
const notifications = rawNotifications.map((notification) =>
processFeatureAnnouncement(notification),
Expand Down

0 comments on commit 57e2089

Please sign in to comment.