diff --git a/package.json b/package.json index abc06fca8..c1dcd0b99 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ }, "license": "MIT", "lbrySettings": { - "lbrynetDaemonVersion": "0.18.2", + "lbrynetDaemonVersion": "0.19.0", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-daemon-vDAEMONVER-OSNAME.zip" } } diff --git a/src/renderer/component/fileList/index.js b/src/renderer/component/fileList/index.js index 3b6ced934..bfaff712a 100644 --- a/src/renderer/component/fileList/index.js +++ b/src/renderer/component/fileList/index.js @@ -1,8 +1,11 @@ import React from 'react'; import { connect } from 'react-redux'; import FileList from './view'; +import { selectClaimsById } from 'redux/selectors/claims'; -const select = state => ({}); +const select = state => ({ + claimsById: selectClaimsById(state), +}); const perform = dispatch => ({}); diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index eef0993c6..686665078 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -13,48 +13,53 @@ class FileList extends React.PureComponent { }; this._sortFunctions = { - dateNew(fileInfos) { - return fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = fileInfo1.height; - const height2 = fileInfo2.height; + dateNew: fileInfos => + fileInfos.slice().sort((fileInfo1, fileInfo2) => { + const height1 = this.props.claimsById[fileInfo1.claim_id] + ? this.props.claimsById[fileInfo1.claim_id].height + : 0; + const height2 = this.props.claimsById[fileInfo2.claim_id] + ? this.props.claimsById[fileInfo2.claim_id].height + : 0; if (height1 > height2) { return -1; } else if (height1 < height2) { return 1; } return 0; - }); - }, - dateOld(fileInfos) { - return fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = fileInfo1.height; - const height2 = fileInfo2.height; + }), + dateOld: fileInfos => + fileInfos.slice().sort((fileInfo1, fileInfo2) => { + const height1 = this.props.claimsById[fileInfo1.claim_id] + ? this.props.claimsById[fileInfo1.claim_id].height + : 999999; + const height2 = this.props.claimsById[fileInfo2.claim_id] + ? this.props.claimsById[fileInfo2.claim_id].height + : 999999; if (height1 < height2) { return -1; } else if (height1 > height2) { return 1; } return 0; - }); - }, - title(fileInfos) { - return fileInfos.slice().sort((fileInfo1, fileInfo2) => { + }), + title: fileInfos => + fileInfos.slice().sort((fileInfo1, fileInfo2) => { const title1 = fileInfo1.value ? fileInfo1.value.stream.metadata.title.toLowerCase() - : fileInfo1.name; + : fileInfo1.claim_name; const title2 = fileInfo2.value ? fileInfo2.value.stream.metadata.title.toLowerCase() - : fileInfo2.name; + : fileInfo2.claim_name; if (title1 < title2) { return -1; } else if (title1 > title2) { return 1; } return 0; - }); - }, - filename(fileInfos) { - return fileInfos.slice().sort(({ file_name: fileName1 }, { file_name: fileName2 }) => { + }), + filename: fileInfos => + fileInfos.slice().sort(({ file_name: fileName1 }, { file_name: fileName2 }) => { const fileName1Lower = fileName1.toLowerCase(); const fileName2Lower = fileName2.toLowerCase(); if (fileName1Lower < fileName2Lower) { @@ -63,8 +68,7 @@ class FileList extends React.PureComponent { return 1; } return 0; - }); - }, + }), }; } @@ -72,7 +76,7 @@ class FileList extends React.PureComponent { if (fileInfo.value) { return fileInfo.value.publisherSignature.certificateId; } - return fileInfo.metadata.publisherSignature.certificateId; + return fileInfo.channel_claim_id; } handleSortChanged(event) { @@ -91,11 +95,11 @@ class FileList extends React.PureComponent { if (fileInfo.channel_name) { uriParams.channelName = fileInfo.channel_name; - uriParams.contentName = fileInfo.name; + uriParams.contentName = fileInfo.claim_name || fileInfo.name; uriParams.claimId = this.getChannelSignature(fileInfo); } else { uriParams.claimId = fileInfo.claim_id; - uriParams.name = fileInfo.name; + uriParams.claimName = fileInfo.claim_name || fileInfo.name; } const uri = buildURI(uriParams); diff --git a/src/renderer/component/fileListSearch/view.jsx b/src/renderer/component/fileListSearch/view.jsx index d29e9d967..89e99ca65 100644 --- a/src/renderer/component/fileListSearch/view.jsx +++ b/src/renderer/component/fileListSearch/view.jsx @@ -45,7 +45,7 @@ class FileListSearch extends React.PureComponent { {uris && uris.length ? uris.map( uri => - parseURI(uri).name[0] === '@' ? ( + parseURI(uri).claimName[0] === '@' ? ( ) : ( diff --git a/src/renderer/component/transactionList/internal/TransactionListItem.jsx b/src/renderer/component/transactionList/internal/TransactionListItem.jsx index 0192e33d1..20d7e4bfd 100644 --- a/src/renderer/component/transactionList/internal/TransactionListItem.jsx +++ b/src/renderer/component/transactionList/internal/TransactionListItem.jsx @@ -74,7 +74,7 @@ class TransactionListItem extends React.PureComponent { {name} diff --git a/src/renderer/component/userPhoneVerify/view.jsx b/src/renderer/component/userPhoneVerify/view.jsx index 2ee39c1e8..225fad5d1 100644 --- a/src/renderer/component/userPhoneVerify/view.jsx +++ b/src/renderer/component/userPhoneVerify/view.jsx @@ -33,9 +33,7 @@ class UserPhoneVerify extends React.PureComponent {

{__( - `Please enter the verification code sent to +${countryCode}${ - phone - }. Didn't receive it? ` + `Please enter the verification code sent to +${countryCode}${phone}. Didn't receive it? ` )}

diff --git a/src/renderer/constants/action_types.js b/src/renderer/constants/action_types.js index 584fa7a47..f4a993143 100644 --- a/src/renderer/constants/action_types.js +++ b/src/renderer/constants/action_types.js @@ -62,8 +62,8 @@ export const FETCH_CLAIM_LIST_MINE_STARTED = 'FETCH_CLAIM_LIST_MINE_STARTED'; export const FETCH_CLAIM_LIST_MINE_COMPLETED = 'FETCH_CLAIM_LIST_MINE_COMPLETED'; export const ABANDON_CLAIM_STARTED = 'ABANDON_CLAIM_STARTED'; export const ABANDON_CLAIM_SUCCEEDED = 'ABANDON_CLAIM_SUCCEEDED'; -export const FETCH_CHANNEL_LIST_MINE_STARTED = 'FETCH_CHANNEL_LIST_MINE_STARTED'; -export const FETCH_CHANNEL_LIST_MINE_COMPLETED = 'FETCH_CHANNEL_LIST_MINE_COMPLETED'; +export const FETCH_CHANNEL_LIST_STARTED = 'FETCH_CHANNEL_LIST_STARTED'; +export const FETCH_CHANNEL_LIST_COMPLETED = 'FETCH_CHANNEL_LIST_COMPLETED'; export const CREATE_CHANNEL_STARTED = 'CREATE_CHANNEL_STARTED'; export const CREATE_CHANNEL_COMPLETED = 'CREATE_CHANNEL_COMPLETED'; export const PUBLISH_STARTED = 'PUBLISH_STARTED'; diff --git a/src/renderer/lbry.js b/src/renderer/lbry.js index 64ad8517e..79855b4ce 100644 --- a/src/renderer/lbry.js +++ b/src/renderer/lbry.js @@ -211,11 +211,11 @@ Lbry.getAppVersionInfo = () => /** * Returns results from the file_list API method, plus dummy entries for pending publishes. - * (If a real publish with the same name is found, the pending publish will be ignored and removed.) + * (If a real publish with the same claim name is found, the pending publish will be ignored and removed.) */ Lbry.file_list = (params = {}) => new Promise((resolve, reject) => { - const { name, channel_name: channelName, outpoint } = params; + const { claim_name: claimName, channel_name: channelName, outpoint } = params; /** * If we're searching by outpoint, check first to see if there's a matching pending publish. @@ -234,10 +234,10 @@ Lbry.file_list = (params = {}) => 'file_list', params, fileInfos => { - removePendingPublishIfNeeded({ name, channelName, outpoint }); + removePendingPublishIfNeeded({ name: claimName, channelName, outpoint }); // if a naked file_list call, append the pending file infos - if (!name && !channelName && !outpoint) { + if (!claimName && !channelName && !outpoint) { const dummyFileInfos = Lbry.getPendingPublishes().map(pendingPublishToDummyFileInfo); resolve([...fileInfos, ...dummyFileInfos]); diff --git a/src/renderer/lbryURI.js b/src/renderer/lbryURI.js index e0691965e..9fd136b92 100644 --- a/src/renderer/lbryURI.js +++ b/src/renderer/lbryURI.js @@ -30,11 +30,11 @@ export function parseURI(URI, requireProto = false) { // Break into components. Empty sub-matches are converted to null const componentsRegex = new RegExp( '^((?:lbry://)?)' + // protocol - '([^:$#/]*)' + // name (stops at the first separator or end) + '([^:$#/]*)' + // claim name (stops at the first separator or end) '([:$#]?)([^/]*)' + // modifier separator, modifier (stops at the first path separator or end) '(/?)(.*)' // path separator, path ); - const [proto, name, modSep, modVal, pathSep, path] = componentsRegex + const [proto, claimName, modSep, modVal, pathSep, path] = componentsRegex .exec(URI) .slice(1) .map(match => match || null); @@ -47,12 +47,12 @@ export function parseURI(URI, requireProto = false) { } // Validate and process name - if (!name) { + if (!claimName) { throw new Error(__('URI does not include name.')); } - const isChannel = name.startsWith('@'); - const channelName = isChannel ? name.slice(1) : name; + const isChannel = claimName.startsWith('@'); + const channelName = isChannel ? claimName.slice(1) : claimName; if (isChannel) { if (!channelName) { @@ -66,7 +66,7 @@ export function parseURI(URI, requireProto = false) { contentName = path; } - const nameBadChars = (channelName || name).match(regexInvalidURI); + const nameBadChars = (channelName || claimName).match(regexInvalidURI); if (nameBadChars) { throw new Error( __( @@ -128,7 +128,7 @@ export function parseURI(URI, requireProto = false) { } return { - name, + claimName, path, isChannel, ...(contentName ? { contentName } : {}), @@ -148,24 +148,24 @@ export function parseURI(URI, requireProto = false) { export function buildURI(URIObj, includeProto = true) { const { claimId, claimSequence, bidPosition, contentName, channelName } = URIObj; - let { name, path } = URIObj; + let { claimName, path } = URIObj; if (channelName) { const channelNameFormatted = channelName.startsWith('@') ? channelName : `@${channelName}`; - if (!name) { - name = channelNameFormatted; - } else if (name !== channelNameFormatted) { + if (!claimName) { + claimName = channelNameFormatted; + } else if (claimName !== channelNameFormatted) { throw new Error( __( - 'Received a channel content URI, but name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.' + 'Received a channel content URI, but claim name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.' ) ); } } if (contentName) { - if (!name) { - name = contentName; + if (!claimName) { + claimName = contentName; } else if (!path) { path = contentName; } @@ -180,7 +180,7 @@ export function buildURI(URIObj, includeProto = true) { return ( (includeProto ? 'lbry://' : '') + - name + + claimName + (claimId ? `#${claimId}` : '') + (claimSequence ? `:${claimSequence}` : '') + (bidPosition ? `${bidPosition}` : '') + @@ -192,8 +192,8 @@ export function buildURI(URIObj, includeProto = true) { export function normalizeURI(URI) { if (URI.match(/pending_claim/)) return URI; - const { name, path, bidPosition, claimSequence, claimId } = parseURI(URI); - return buildURI({ name, path, claimSequence, bidPosition, claimId }); + const { claimName, path, bidPosition, claimSequence, claimId } = parseURI(URI); + return buildURI({ claimName, path, claimSequence, bidPosition, claimId }); } export function isURIValid(URI) { @@ -203,12 +203,12 @@ export function isURIValid(URI) { } catch (error) { return false; } - return parts && parts.name; + return parts && parts.claimName; } -export function isNameValid(name, checkCase = true) { +export function isNameValid(claimName, checkCase = true) { const regexp = new RegExp('^[a-z0-9-]+$', checkCase ? '' : 'i'); - return regexp.test(name); + return regexp.test(claimName); } export function isURIClaimable(URI) { @@ -220,7 +220,7 @@ export function isURIClaimable(URI) { } return ( parts && - parts.name && + parts.claimName && !parts.claimId && !parts.bidPosition && !parts.claimSequence && diff --git a/src/renderer/page/channel/view.jsx b/src/renderer/page/channel/view.jsx index ae1f6b332..4614bb5c7 100644 --- a/src/renderer/page/channel/view.jsx +++ b/src/renderer/page/channel/view.jsx @@ -58,7 +58,7 @@ class ChannelPage extends React.PureComponent { { dispatch({ - type: ACTIONS.FETCH_CHANNEL_LIST_MINE_STARTED, + type: ACTIONS.FETCH_CHANNEL_LIST_STARTED, }); const callback = channels => { dispatch({ - type: ACTIONS.FETCH_CHANNEL_LIST_MINE_COMPLETED, + type: ACTIONS.FETCH_CHANNEL_LIST_COMPLETED, data: { claims: channels }, }); }; - Lbry.channel_list_mine().then(callback); + Lbry.channel_list().then(callback); }; } @@ -523,7 +521,7 @@ export function doAbandonClaim(txid, nout) { claimId, }, }); - dispatch(doResolveUri(buildURI({ name, claimId }))); + dispatch(doResolveUri(buildURI({ claimName: name, claimId }))); dispatch(doFetchClaimListMine()); } else { dispatch(doOpenModal(MODALS.TRANSACTION_FAILED)); diff --git a/src/renderer/redux/actions/search.js b/src/renderer/redux/actions/search.js index e8922f650..b4b12cd57 100644 --- a/src/renderer/redux/actions/search.js +++ b/src/renderer/redux/actions/search.js @@ -41,7 +41,7 @@ export function doSearch(rawQuery) { data.forEach(result => { const uri = buildURI({ - name: result.name, + claimName: result.name, claimId: result.claimId, }); actions.push(doResolveUri(uri)); diff --git a/src/renderer/redux/actions/wallet.js b/src/renderer/redux/actions/wallet.js index df2faeb8d..6422b6315 100644 --- a/src/renderer/redux/actions/wallet.js +++ b/src/renderer/redux/actions/wallet.js @@ -35,7 +35,7 @@ export function doFetchTransactions() { type: ACTIONS.FETCH_TRANSACTIONS_STARTED, }); - Lbry.transaction_list({ include_tip_info: true }).then(results => { + Lbry.transaction_list().then(results => { dispatch({ type: ACTIONS.FETCH_TRANSACTIONS_COMPLETED, data: { diff --git a/src/renderer/redux/reducers/claims.js b/src/renderer/redux/reducers/claims.js index 73eee7815..5078bfccc 100644 --- a/src/renderer/redux/reducers/claims.js +++ b/src/renderer/redux/reducers/claims.js @@ -71,10 +71,10 @@ reducers[ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED] = (state, action) => { }); }; -reducers[ACTIONS.FETCH_CHANNEL_LIST_MINE_STARTED] = state => +reducers[ACTIONS.FETCH_CHANNEL_LIST_STARTED] = state => Object.assign({}, state, { fetchingMyChannels: true }); -reducers[ACTIONS.FETCH_CHANNEL_LIST_MINE_COMPLETED] = (state, action) => { +reducers[ACTIONS.FETCH_CHANNEL_LIST_COMPLETED] = (state, action) => { const { claims } = action.data; const myChannelClaims = new Set(state.myChannelClaims); const byId = Object.assign({}, state.byId); diff --git a/src/renderer/scss/component/_checkbox.scss b/src/renderer/scss/component/_checkbox.scss index b72f7c896..d4796afe6 100644 --- a/src/renderer/scss/component/_checkbox.scss +++ b/src/renderer/scss/component/_checkbox.scss @@ -51,7 +51,7 @@ $md-checkmark-color: #fff; border: none; } + label:after { - $md-checkmark-size: $md-checkbox-size - 2*$md-checkbox-padding; + $md-checkmark-size: $md-checkbox-size - 2 * $md-checkbox-padding; transform: rotate(-45deg); diff --git a/src/renderer/scss/component/_table.scss b/src/renderer/scss/component/_table.scss index 1c6b17369..428c5d152 100644 --- a/src/renderer/scss/component/_table.scss +++ b/src/renderer/scss/component/_table.scss @@ -18,7 +18,7 @@ table.table-standard { vertical-align: bottom; font-weight: 500; font-size: 0.9em; - padding: $spacing-vertical/4+1 8px $spacing-vertical/4-2; + padding: $spacing-vertical/4 + 1 8px $spacing-vertical/4-2; text-align: left; border-bottom: var(--table-border); img { diff --git a/src/renderer/scss/component/_tooltip.scss b/src/renderer/scss/component/_tooltip.scss index d017996c1..91fbe3f2f 100644 --- a/src/renderer/scss/component/_tooltip.scss +++ b/src/renderer/scss/component/_tooltip.scss @@ -20,14 +20,14 @@ border: var(--tooltip-border); color: var(--tooltip-color); background-color: var(--tooltip-bg); - font-size: calc(var(--font-size) * 7/8); + font-size: calc(var(--font-size) * 7 / 8); line-height: var(--font-line-height); box-shadow: var(--box-shadow-layer); } .tooltip--header .tooltip__link { @include text-link(#aaa); - font-size: calc(var(--font-size) * 3/4); + font-size: calc(var(--font-size) * 3 / 4); margin-left: var(--button-padding); vertical-align: middle; }