rename lbryio notifications
This commit is contained in:
parent
9f40680b64
commit
f532aa2566
7 changed files with 19 additions and 19 deletions
|
@ -344,9 +344,9 @@ export const MEDIA_PLAY = 'MEDIA_PLAY';
|
|||
export const MEDIA_PAUSE = 'MEDIA_PAUSE';
|
||||
|
||||
// Notifications
|
||||
export const NOTIFICATION_LIST_STARTED = 'NOTIFICATION_LIST_STARTED';
|
||||
export const NOTIFICATION_LIST_COMPLETED = 'NOTIFICATION_LIST_COMPLETED';
|
||||
export const NOTIFICATION_LIST_FAILED = 'NOTIFICATION_LIST_FAILED';
|
||||
export const LBRYIO_NOTIFICATION_LIST_STARTED = 'NOTIFICATION_LIST_STARTED';
|
||||
export const LBRYIO_NOTIFICATION_LIST_COMPLETED = 'NOTIFICATION_LIST_COMPLETED';
|
||||
export const LBRYIO_NOTIFICATION_LIST_FAILED = 'NOTIFICATION_LIST_FAILED';
|
||||
export const NOTIFICATION_CATEGORIES_COMPLETED = 'NOTIFICATION_CATEGORIES_COMPLETED';
|
||||
export const NOTIFICATION_READ_STARTED = 'NOTIFICATION_READ_STARTED';
|
||||
export const NOTIFICATION_READ_COMPLETED = 'NOTIFICATION_READ_COMPLETED';
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from 'redux/selectors/notifications';
|
||||
import { doCommentReactList } from 'redux/actions/comments';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import { doReadNotifications, doNotificationList, doSeeAllNotifications } from 'redux/actions/notifications';
|
||||
import { doReadNotifications, doLbryioNotificationList, doSeeAllNotifications } from 'redux/actions/notifications';
|
||||
import NotificationsPage from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
|
@ -24,7 +24,7 @@ const select = (state) => ({
|
|||
|
||||
export default connect(select, {
|
||||
doReadNotifications,
|
||||
doNotificationList,
|
||||
doLbryioNotificationList,
|
||||
doSeeAllNotifications,
|
||||
doCommentReactList,
|
||||
})(NotificationsPage);
|
||||
|
|
|
@ -21,7 +21,7 @@ type Props = {
|
|||
unseenCount: number,
|
||||
doSeeAllNotifications: () => void,
|
||||
doReadNotifications: () => void,
|
||||
doNotificationList: (?Array<string>) => void,
|
||||
doLbryioNotificationList: (?Array<string>) => void,
|
||||
activeChannel: ?ChannelClaim,
|
||||
doCommentReactList: (Array<string>) => Promise<any>,
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ export default function NotificationsPage(props: Props) {
|
|||
unseenCount,
|
||||
doSeeAllNotifications,
|
||||
doReadNotifications,
|
||||
doNotificationList,
|
||||
doLbryioNotificationList,
|
||||
notificationCategories,
|
||||
activeChannel,
|
||||
doCommentReactList,
|
||||
|
@ -97,7 +97,7 @@ export default function NotificationsPage(props: Props) {
|
|||
try {
|
||||
const matchingCategory = arrayNotificationCategories.find((category) => category.name === name);
|
||||
if (matchingCategory) {
|
||||
doNotificationList(matchingCategory.types);
|
||||
doLbryioNotificationList(matchingCategory.types);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
|
@ -16,7 +16,7 @@ import { doClearSupport, doBalanceSubscribe } from 'redux/actions/wallet';
|
|||
import { doClearPublish } from 'redux/actions/publish';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
import { selectFollowedTagsList } from 'redux/selectors/tags';
|
||||
import { doToast, doError, doNotificationList } from 'redux/actions/notifications';
|
||||
import { doToast, doError, doLbryioNotificationList } from 'redux/actions/notifications';
|
||||
|
||||
import {
|
||||
doFetchDaemonSettings,
|
||||
|
@ -509,7 +509,7 @@ export function doSignIn() {
|
|||
dispatch(doNotificationSocketConnect(notificationsEnabled));
|
||||
|
||||
if (notificationsEnabled) {
|
||||
dispatch(doNotificationList());
|
||||
dispatch(doLbryioNotificationList());
|
||||
}
|
||||
dispatch(doCheckPendingClaims());
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ export function doDismissError() {
|
|||
};
|
||||
}
|
||||
|
||||
export function doNotificationList(types?: Array<string>) {
|
||||
export function doLbryioNotificationList(types?: Array<string>) {
|
||||
return async (dispatch: Dispatch, getState: GetState) => {
|
||||
const state = getState();
|
||||
const notificationTypes = selectNotificationCategories(state);
|
||||
|
||||
dispatch({ type: ACTIONS.NOTIFICATION_LIST_STARTED });
|
||||
dispatch({ type: ACTIONS.LBRYIO_NOTIFICATION_LIST_STARTED });
|
||||
|
||||
let params: any = { is_app_readable: true };
|
||||
if (types) {
|
||||
|
@ -94,7 +94,7 @@ export function doNotificationList(types?: Array<string>) {
|
|||
|
||||
dispatch(doResolveUris(channelsToResolve));
|
||||
dispatch({
|
||||
type: ACTIONS.NOTIFICATION_LIST_COMPLETED,
|
||||
type: ACTIONS.LBRYIO_NOTIFICATION_LIST_COMPLETED,
|
||||
data: {
|
||||
newNotifications: notifications,
|
||||
filterRule: Boolean(types),
|
||||
|
@ -102,7 +102,7 @@ export function doNotificationList(types?: Array<string>) {
|
|||
});
|
||||
});
|
||||
} catch (error) {
|
||||
dispatch({ type: ACTIONS.NOTIFICATION_LIST_FAILED, data: { error } });
|
||||
dispatch({ type: ACTIONS.LBRYIO_NOTIFICATION_LIST_FAILED, data: { error } });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as ACTIONS from 'constants/action_types';
|
||||
import { getAuthToken } from 'util/saved-passwords';
|
||||
import { doNotificationList } from 'redux/actions/notifications';
|
||||
import { doLbryioNotificationList } from 'redux/actions/notifications';
|
||||
import { SOCKETY_SERVER_API } from 'config';
|
||||
|
||||
const NOTIFICATION_WS_URL = `${SOCKETY_SERVER_API}/internal?id=`;
|
||||
|
@ -79,7 +79,7 @@ export const doNotificationSocketConnect = (enableNotifications) => (dispatch) =
|
|||
switch (data.type) {
|
||||
case 'pending_notification':
|
||||
if (enableNotifications) {
|
||||
dispatch(doNotificationList());
|
||||
dispatch(doLbryioNotificationList());
|
||||
}
|
||||
break;
|
||||
case 'swap-status':
|
||||
|
|
|
@ -35,13 +35,13 @@ export default handleActions(
|
|||
},
|
||||
|
||||
// Notifications
|
||||
[ACTIONS.NOTIFICATION_LIST_STARTED]: (state, action) => {
|
||||
[ACTIONS.LBRYIO_NOTIFICATION_LIST_STARTED]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
fetchingNotifications: true,
|
||||
};
|
||||
},
|
||||
[ACTIONS.NOTIFICATION_LIST_COMPLETED]: (state, action) => {
|
||||
[ACTIONS.LBRYIO_NOTIFICATION_LIST_COMPLETED]: (state, action) => {
|
||||
const { filterRule, newNotifications } = action.data;
|
||||
if (filterRule) {
|
||||
return {
|
||||
|
@ -57,7 +57,7 @@ export default handleActions(
|
|||
};
|
||||
}
|
||||
},
|
||||
[ACTIONS.NOTIFICATION_LIST_FAILED]: (state, action) => {
|
||||
[ACTIONS.LBRYIO_NOTIFICATION_LIST_FAILED]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
fetchingNotifications: false,
|
||||
|
|
Loading…
Add table
Reference in a new issue