Skip to content

Commit

Permalink
#732 New release notification: add redirection to the new version dow…
Browse files Browse the repository at this point in the history
…nload page
  • Loading branch information
Yaroslav Tsimokha committed Jul 8, 2019
1 parent 7b5cd7a commit 993a0fe
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mobile/src/notifications/notification.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { logError } from '../utils/analytics';
import { LoadUserFinished } from '../reducers/user/user.action';
import { NotificationType } from './notifications';
import { loadPendingRequests } from '../reducers/calendar/pending-requests/pending-requests.action';
import config from '../config';

//----------------------------------------------------------------------------
const notificationsHandler$ = (action$: ActionsObservable<LoadUserFinished>, state$: StateObservable<AppState>) =>
Expand All @@ -41,15 +42,11 @@ const notificationsHandler$ = (action$: ActionsObservable<LoadUserFinished>, sta
}

const currentEmployeeId = state$.value.userInfo.employeeId;
const { type, employeeId, approverId, url } = notification.customProperties;
const { type, employeeId, approverId } = notification.customProperties;

switch (type) {
case NotificationType.UpdateAvailable:
if (!url) {
logError('Unexpected notification payload', notification.customProperties);
} else {
Linking.openURL(url).catch(err => console.error(err));
}
Linking.openURL(config.downloadLink).catch(err => console.error(err));
break;
case NotificationType.EventAssignedToApprover:
case NotificationType.EventStatusChanged:
Expand Down

0 comments on commit 993a0fe

Please sign in to comment.