* fix: channel button color on dark mode

* fix: disabled primary button in dark mode

* fix: show pending publishes immediately

* update lbry-redux

* remove duplicate import

* use lbry colors for 'new' badge

* fix: don't filter transactions in recent transactions

* fix: remove unread subscriptions on un-subscribe

* handle edits and new files the same for pending publishes

* don't loop over transactions if we don't have to

* bump lbry-redux
This commit is contained in:
Sean Yesmunt 2018-11-02 14:33:00 -04:00 committed by GitHub
parent bbf6696054
commit 121e4b215f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 81 additions and 30 deletions

View file

@ -43,6 +43,7 @@
"class-methods-use-this": 0,
"jsx-a11y/interactive-supports-focus": 0,
"jsx-a11y/click-events-have-key-events": 0,
"consistent-return": 0
"consistent-return": 0,
"flowtype/space-after-type-colon": [ 2, "always", { "allowLineBreak": true } ]
}
}

View file

@ -49,7 +49,7 @@
"formik": "^0.10.4",
"hast-util-sanitize": "^1.1.2",
"keytar": "^4.2.1",
"lbry-redux": "lbryio/lbry-redux#f193d38c61ea061679ebc7b4ca139a0e9c95ef8a",
"lbry-redux": "lbryio/lbry-redux#dd26422a86a37b5a492dc0702269ad6fc04ecdd7",
"lbryinc": "lbryio/lbryinc#7a458ea13ceceffa0191e73139f94e5c953f22b1",
"localforage": "^1.7.1",
"mammoth": "^1.4.6",

View file

@ -66,7 +66,10 @@ class TransactionList extends React.PureComponent<Props> {
render() {
const { emptyMessage, rewards, transactions, slim, filterSetting } = this.props;
const transactionList = transactions.filter(this.filterTransaction);
// The shorter "recent transactions" list shouldn't be filtered
const transactionList = slim ? transactions : transactions.filter(this.filterTransaction);
// Flow offers little support for Object.values() typing.
// https://github.com/facebook/flow/issues/2221
// $FlowFixMe

View file

@ -1,6 +1,9 @@
import { connect } from 'react-redux';
import { selectPendingPublishes } from 'redux/selectors/publish';
import { selectIsFetchingClaimListMine, selectFileListPublishedSort, selectMyClaimsWithoutChannels } from 'lbry-redux';
import {
selectIsFetchingClaimListMine,
selectFileListPublishedSort,
selectMyClaimsWithoutChannels,
} from 'lbry-redux';
import { doNavigate } from 'redux/actions/navigation';
import { doCheckPendingPublishes } from 'redux/actions/publish';
import FileListPublished from './view';

View file

@ -22,7 +22,6 @@ class FileListPublished extends React.PureComponent<Props> {
render() {
const { fetching, claims, navigate, sortBy } = this.props;
return (
<Page notContained loading={fetching}>
{claims && claims.length ? (

View file

@ -16,6 +16,7 @@ import {
batchActions,
creditsToString,
selectPendingById,
selectMyClaimsWithoutChannels,
} from 'lbry-redux';
import { selectosNotificationsEnabled } from 'redux/selectors/settings';
import { doNavigate } from 'redux/actions/navigation';
@ -199,6 +200,7 @@ export const doPublish = (params: PublishParams) => (
) => {
const state = getState();
const myChannels = selectMyChannelClaims(state);
const myClaims = selectMyClaimsWithoutChannels(state);
const {
name,
@ -223,7 +225,7 @@ export const doPublish = (params: PublishParams) => (
const channelId = namedChannelClaim ? namedChannelClaim.claim_id : '';
const fee = contentIsFree || !price.amount ? undefined : { ...price };
const metadata = {
const metadata: Metadata = {
title,
nsfw,
license,
@ -262,11 +264,32 @@ export const doPublish = (params: PublishParams) => (
dispatch({ type: ACTIONS.PUBLISH_START });
const success = () => {
dispatch({
const success = pendingClaim => {
const actions = [];
actions.push({
type: ACTIONS.PUBLISH_SUCCESS,
});
dispatch(doNotify({ id: MODALS.PUBLISH }, { uri }));
actions.push(doNotify({ id: MODALS.PUBLISH }, { uri }));
// We have to fake a temp claim until the new pending one is returned by claim_list_mine
// We can't rely on claim_list_mine because there might be some delay before the new claims are returned
// Doing this allows us to show the pending claim immediately, it will get overwritten by the real one
const isMatch = claim => claim.claim_id === pendingClaim.claim_id;
const isEdit = myClaims.some(isMatch);
const myNewClaims = isEdit
? myClaims.map(claim => (isMatch(claim) ? pendingClaim.output : claim))
: myClaims.concat(pendingClaim.output);
actions.push({
type: ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED,
data: {
claims: myNewClaims,
},
});
dispatch(batchActions(...actions));
};
const failure = error => {
@ -281,7 +304,8 @@ export const doPublish = (params: PublishParams) => (
export const doCheckPendingPublishes = () => (dispatch: Dispatch<Action>, getState: GetState) => {
const state = getState();
const pendingById = selectPendingById(state);
if (!Object.keys(pendingById)) {
if (!Object.keys(pendingById).length) {
return;
}
@ -289,8 +313,9 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch<Action>, getSta
const checkFileList = () => {
Lbry.claim_list_mine().then(claims => {
console.log('check');
claims.forEach(claim => {
// If it's confirmed, check that it wasn't pending previously
// If it's confirmed, check if it was pending previously
if (claim.confirmations > 0 && pendingById[claim.claim_id]) {
delete pendingById[claim.claim_id];
@ -326,7 +351,6 @@ export const doCheckPendingPublishes = () => (dispatch: Dispatch<Action>, getSta
});
};
checkFileList();
publishCheckInterval = setInterval(() => {
checkFileList();
}, 30000);

View file

@ -41,13 +41,18 @@ export default handleActions(
action: DoChannelUnsubscribe
): SubscriptionState => {
const subscriptionToRemove: Subscription = action.data;
const newSubscriptions = state.subscriptions
.slice()
.filter(subscription => subscription.channelName !== subscriptionToRemove.channelName);
// Check if we need to remove it from the 'unread' state
const { unread } = state.unread;
if (unread[subscriptionToRemove.uri]) {
delete unread[subscriptionToRemove.uri];
}
return {
...state,
...unread,
subscriptions: newSubscriptions,
};
},

View file

@ -5,5 +5,5 @@
'component/snack-bar', 'component/content', 'component/pagination', 'component/markdown-preview',
'component/markdown-editor', 'component/scrollbar', 'component/spinner', 'component/nav',
'component/file-list', 'component/file-render', 'component/search', 'component/toggle',
'component/search', 'component/dat-gui', 'component/item-list', 'component/time', 'component/icon',
'component/dat-gui', 'component/item-list', 'component/time', 'component/icon',
'component/placeholder', 'component/badge', 'themes/dark';

View file

@ -6,8 +6,8 @@
}
.badge--alert {
background-color: #e45454;
color: white;
background-color: $lbry-red-3;
color: $lbry-white;
}
.badge--free {

View file

@ -74,8 +74,7 @@
}
}
&.btn--disabled:disabled {
// wtf?
&:disabled {
cursor: default;
&.btn--primary {

View file

@ -82,11 +82,20 @@ html[data-theme='dark'] {
background-color: rgba($lbry-red-1, 0.1);
}
.btn.btn--alt:not(:disabled) {
//
// BUTTON
//
.btn {
&.btn--alt:not(:disabled) {
background-color: rgba($lbry-white, 0.1);
color: $lbry-gray-1;
}
&.btn--primary:disabled {
background-color: rgba($lbry-teal-5, 0.15);
}
}
.search__top {
background-color: rgba($lbry-white, 0.15);
}
@ -121,10 +130,6 @@ html[data-theme='dark'] {
background-color: rgba($lbry-black, 0.7);
}
.btn {
color: $lbry-gray-3;
}
.modal {
background-color: rgba($lbry-black, 0.9);
border: 1px solid rgba($lbry-gray-1, 0.1);

View file

@ -14,6 +14,18 @@ export type Metadata = {
title: string,
thumbnail: ?string,
description: ?string,
fee?:
| {
amount: number, // should be a string https://github.com/lbryio/lbry/issues/1576
currency: string,
address: string,
version: string,
}
| {
// We don't include a version or address in the metadata field when publishing
amount: number,
currency: string,
},
};
// Actual claim type has more values than this

View file

@ -5663,16 +5663,16 @@ lazy-val@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2:
lbry-redux@lbryio/lbry-redux#0e13dd1972e3b40821fee2f9f06e1a0631913aa9:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/2375860d6269d0369418879c2531b1d48c4e47f2"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/0e13dd1972e3b40821fee2f9f06e1a0631913aa9"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"
lbry-redux@lbryio/lbry-redux#f193d38c61ea061679ebc7b4ca139a0e9c95ef8a:
lbry-redux@lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/f193d38c61ea061679ebc7b4ca139a0e9c95ef8a"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/2375860d6269d0369418879c2531b1d48c4e47f2"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"