fix: pub key / cert check
And selection of address. fix: check for cert
This commit is contained in:
parent
34b91fca23
commit
3b2776395b
3 changed files with 11 additions and 11 deletions
6
dist/bundle.es.js
vendored
6
dist/bundle.es.js
vendored
|
@ -1372,13 +1372,13 @@ function doClaimYoutubeChannels() {
|
|||
dispatch({
|
||||
type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_STARTED
|
||||
});
|
||||
lbryRedux.Lbry.address_list().then(addressList => addressList.find(el => el.used_times === 0)).then(address => Lbryio.call('yt', 'transfer', {
|
||||
lbryRedux.Lbry.address_list().then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0]).then(address => Lbryio.call('yt', 'transfer', {
|
||||
address: address.address,
|
||||
public_key: address.public_key
|
||||
public_key: address.pubkey
|
||||
}).then(response => {
|
||||
if (response && response.success) {
|
||||
Promise.all(response.map(channelMeta => {
|
||||
if (channelMeta && channelMeta.channel && channelMeta.channel.transferable) {
|
||||
if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) {
|
||||
return lbryRedux.Lbry.channel_import({
|
||||
channel_data: channelMeta.channel.channel_certificate
|
||||
});
|
||||
|
|
10
dist/bundle.js
vendored
10
dist/bundle.js
vendored
|
@ -2827,17 +2827,17 @@ function doClaimYoutubeChannels() {
|
|||
type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_STARTED
|
||||
});
|
||||
lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].address_list().then(function (addressList) {
|
||||
return addressList.find(function (el) {
|
||||
return el.used_times === 0;
|
||||
});
|
||||
return addressList.sort(function (a, b) {
|
||||
return a.used_times - b.used_times;
|
||||
})[0];
|
||||
}).then(function (address) {
|
||||
return lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('yt', 'transfer', {
|
||||
address: address.address,
|
||||
public_key: address.public_key
|
||||
public_key: address.pubkey
|
||||
}).then(function (response) {
|
||||
if (response && response.success) {
|
||||
Promise.all(response.map(function (channelMeta) {
|
||||
if (channelMeta && channelMeta.channel && channelMeta.channel.transferable) {
|
||||
if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) {
|
||||
return lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].channel_import({
|
||||
channel_data: channelMeta.channel.channel_certificate
|
||||
});
|
||||
|
|
|
@ -389,16 +389,16 @@ export function doClaimYoutubeChannels() {
|
|||
type: ACTIONS.USER_YOUTUBE_IMPORT_STARTED,
|
||||
});
|
||||
Lbry.address_list()
|
||||
.then(addressList => addressList.find(el => el.used_times === 0))
|
||||
.then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0])
|
||||
.then(address =>
|
||||
Lbryio.call('yt', 'transfer', {
|
||||
address: address.address,
|
||||
public_key: address.public_key,
|
||||
public_key: address.pubkey,
|
||||
}).then(response => {
|
||||
if (response && response.success) {
|
||||
Promise.all(
|
||||
response.map(channelMeta => {
|
||||
if (channelMeta && channelMeta.channel && channelMeta.channel.transferable) {
|
||||
if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) {
|
||||
return Lbry.channel_import({
|
||||
channel_data: channelMeta.channel.channel_certificate,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue