add selector for creatingchannel
This commit is contained in:
parent
123efacf4d
commit
9d78fbb62d
4 changed files with 27 additions and 4 deletions
13
dist/bundle.es.js
vendored
13
dist/bundle.es.js
vendored
|
@ -1461,6 +1461,8 @@ const selectClaimsById = reselect.createSelector(selectState$2, state => state.b
|
||||||
|
|
||||||
const selectCurrentChannelPage = reselect.createSelector(selectState$2, state => state.currentChannelPage || 1);
|
const selectCurrentChannelPage = reselect.createSelector(selectState$2, state => state.currentChannelPage || 1);
|
||||||
|
|
||||||
|
const selectCreatingChannel = reselect.createSelector(selectState$2, state => state.creatingChannel);
|
||||||
|
|
||||||
const selectClaimsByUri = reselect.createSelector(selectState$2, selectClaimsById, (state, byId) => {
|
const selectClaimsByUri = reselect.createSelector(selectState$2, selectClaimsById, (state, byId) => {
|
||||||
const byUri = state.claimsByUri || {};
|
const byUri = state.claimsByUri || {};
|
||||||
const claims = {};
|
const claims = {};
|
||||||
|
@ -3564,7 +3566,8 @@ const defaultState = {
|
||||||
claimSearchByQueryLastPageReached: {},
|
claimSearchByQueryLastPageReached: {},
|
||||||
fetchingClaimSearchByQuery: {},
|
fetchingClaimSearchByQuery: {},
|
||||||
updateChannelError: '',
|
updateChannelError: '',
|
||||||
updatingChannel: false
|
updatingChannel: false,
|
||||||
|
creatingChannel: false
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleClaimAction(state, action) {
|
function handleClaimAction(state, action) {
|
||||||
|
@ -3782,6 +3785,10 @@ reducers[ABANDON_CLAIM_SUCCEEDED] = (state, action) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
reducers[CREATE_CHANNEL_STARTED] = state => _extends$5({}, state, {
|
||||||
|
creatingChannel: true
|
||||||
|
});
|
||||||
|
|
||||||
reducers[CREATE_CHANNEL_COMPLETED] = (state, action) => {
|
reducers[CREATE_CHANNEL_COMPLETED] = (state, action) => {
|
||||||
const channelClaim = action.data.channelClaim;
|
const channelClaim = action.data.channelClaim;
|
||||||
const byId = Object.assign({}, state.byId);
|
const byId = Object.assign({}, state.byId);
|
||||||
|
@ -3792,7 +3799,8 @@ reducers[CREATE_CHANNEL_COMPLETED] = (state, action) => {
|
||||||
|
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
byId,
|
byId,
|
||||||
myChannelClaims
|
myChannelClaims,
|
||||||
|
creatingChannel: false
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5001,6 +5009,7 @@ exports.selectClaimSearchByQuery = selectClaimSearchByQuery;
|
||||||
exports.selectClaimSearchByQueryLastPageReached = selectClaimSearchByQueryLastPageReached;
|
exports.selectClaimSearchByQueryLastPageReached = selectClaimSearchByQueryLastPageReached;
|
||||||
exports.selectClaimsById = selectClaimsById;
|
exports.selectClaimsById = selectClaimsById;
|
||||||
exports.selectClaimsByUri = selectClaimsByUri;
|
exports.selectClaimsByUri = selectClaimsByUri;
|
||||||
|
exports.selectCreatingChannel = selectCreatingChannel;
|
||||||
exports.selectCurrentChannelPage = selectCurrentChannelPage;
|
exports.selectCurrentChannelPage = selectCurrentChannelPage;
|
||||||
exports.selectDownloadedUris = selectDownloadedUris;
|
exports.selectDownloadedUris = selectDownloadedUris;
|
||||||
exports.selectDownloadingByOutpoint = selectDownloadingByOutpoint;
|
exports.selectDownloadingByOutpoint = selectDownloadingByOutpoint;
|
||||||
|
|
|
@ -202,6 +202,7 @@ export {
|
||||||
selectClaimSearchByQueryLastPageReached,
|
selectClaimSearchByQueryLastPageReached,
|
||||||
selectUpdatingChannel,
|
selectUpdatingChannel,
|
||||||
selectUpdateChannelError,
|
selectUpdateChannelError,
|
||||||
|
selectCreatingChannel,
|
||||||
} from 'redux/selectors/claims';
|
} from 'redux/selectors/claims';
|
||||||
|
|
||||||
export { makeSelectCommentsForUri } from 'redux/selectors/comments';
|
export { makeSelectCommentsForUri } from 'redux/selectors/comments';
|
||||||
|
|
|
@ -24,6 +24,7 @@ type State = {
|
||||||
fetchingClaimSearchByQuery: { [string]: boolean },
|
fetchingClaimSearchByQuery: { [string]: boolean },
|
||||||
claimSearchByQuery: { [string]: Array<string> },
|
claimSearchByQuery: { [string]: Array<string> },
|
||||||
claimSearchByQueryLastPageReached: { [string]: Array<boolean> },
|
claimSearchByQueryLastPageReached: { [string]: Array<boolean> },
|
||||||
|
creatingChannel: boolean,
|
||||||
claimsByChannel: {
|
claimsByChannel: {
|
||||||
[string]: {
|
[string]: {
|
||||||
all: Array<string>,
|
all: Array<string>,
|
||||||
|
@ -54,6 +55,7 @@ const defaultState = {
|
||||||
fetchingClaimSearchByQuery: {},
|
fetchingClaimSearchByQuery: {},
|
||||||
updateChannelError: '',
|
updateChannelError: '',
|
||||||
updatingChannel: false,
|
updatingChannel: false,
|
||||||
|
creatingChannel: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleClaimAction(state: State, action: any): State {
|
function handleClaimAction(state: State, action: any): State {
|
||||||
|
@ -282,6 +284,11 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State =
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
reducers[ACTIONS.CREATE_CHANNEL_STARTED] = (state: State): State => ({
|
||||||
|
...state,
|
||||||
|
creatingChannel: true,
|
||||||
|
});
|
||||||
|
|
||||||
reducers[ACTIONS.CREATE_CHANNEL_COMPLETED] = (state: State, action: any): State => {
|
reducers[ACTIONS.CREATE_CHANNEL_COMPLETED] = (state: State, action: any): State => {
|
||||||
const channelClaim: ChannelClaim = action.data.channelClaim;
|
const channelClaim: ChannelClaim = action.data.channelClaim;
|
||||||
const byId = Object.assign({}, state.byId);
|
const byId = Object.assign({}, state.byId);
|
||||||
|
@ -293,6 +300,7 @@ reducers[ACTIONS.CREATE_CHANNEL_COMPLETED] = (state: State, action: any): State
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
byId,
|
byId,
|
||||||
myChannelClaims,
|
myChannelClaims,
|
||||||
|
creatingChannel: false,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,11 @@ export const selectCurrentChannelPage = createSelector(
|
||||||
state => state.currentChannelPage || 1
|
state => state.currentChannelPage || 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const selectCreatingChannel = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => state.creatingChannel
|
||||||
|
);
|
||||||
|
|
||||||
export const selectClaimsByUri = createSelector(
|
export const selectClaimsByUri = createSelector(
|
||||||
selectState,
|
selectState,
|
||||||
selectClaimsById,
|
selectClaimsById,
|
||||||
|
@ -230,8 +235,8 @@ export const makeSelectDateForUri = (uri: string) =>
|
||||||
(claim.value.release_time
|
(claim.value.release_time
|
||||||
? claim.value.release_time * 1000
|
? claim.value.release_time * 1000
|
||||||
: claim.meta && claim.meta.creation_timestamp
|
: claim.meta && claim.meta.creation_timestamp
|
||||||
? claim.meta.creation_timestamp * 1000
|
? claim.meta.creation_timestamp * 1000
|
||||||
: null);
|
: null);
|
||||||
if (!timestamp) {
|
if (!timestamp) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue