-
Notifications
You must be signed in to change notification settings - Fork 14
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
Pause ALL my notifications #910
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d9640be
pasue notification
dzonidoo 6bbd6ea
changes after review
dzonidoo ec61a4b
Merge branch 'develop' into pause-notification
dzonidoo a56070a
Merge branch 'develop' into pause-notification
dzonidoo 2d41bc7
change after review part II
dzonidoo 352bf48
update user in user-profile section fix
dzonidoo 69ff164
update fullUser in profile-section fix part II
dzonidoo 319acb8
changes after review part III
dzonidoo 32afcbe
Merge branch 'develop' into pause-notification
dzonidoo 653b3ff
fix lint
dzonidoo 6766886
fix lint
dzonidoo 643db3a
changes after review part IV
dzonidoo ee0c552
fix lint and type of updateUserNotificationSchedule functnion
dzonidoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import {get} from 'lodash'; | ||
import {gettext, notify, errorHandler} from 'utils'; | ||
import server from 'server'; | ||
import {IUser} from 'interfaces'; | ||
|
||
export const UPDATE_NOTIFICATION_COUNT = 'UPDATE_NOTIFICATION_COUNT'; | ||
export function updateNotificationCount(count: any) { | ||
return {type: UPDATE_NOTIFICATION_COUNT, count}; | ||
} | ||
|
||
export const INIT_DATA = 'INIT_DATA'; | ||
export function initData(data: any) { | ||
return {type: INIT_DATA, data}; | ||
export function initData(notificationData: any, profileData: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you type props here? |
||
return {type: INIT_DATA, data: {...notificationData, fullUser: profileData.user}}; | ||
} | ||
|
||
export const GET_USER = 'GET_USER'; | ||
export function getUser(user: IUser): {type: string, user: IUser} { | ||
return {type: GET_USER, user}; | ||
} | ||
|
||
|
||
|
@@ -108,3 +114,20 @@ export function pushNotification(push: any): any { | |
} | ||
}; | ||
} | ||
|
||
export function updateUserNotificationPause() { | ||
tomaskikutis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return (dispatch: any, getState: any) => { | ||
const fullUser = getState().fullUser; | ||
return dispatch(fetchUser(fullUser._id)); | ||
tomaskikutis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
} | ||
|
||
export function fetchUser(id: any) { | ||
return function (dispatch: any) { | ||
return server.get(`/users/${id}`) | ||
.then((data: IUser) => { | ||
dispatch(getUser(data)); | ||
}) | ||
.catch((error: any) => errorHandler(error, dispatch)); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If it's quick, can you type the props as well?