mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-30 17:01:25 +00:00
better handle uris on publish page
This commit is contained in:
parent
101f511e85
commit
8aef97f8cd
4 changed files with 10 additions and 6 deletions
|
@ -124,7 +124,7 @@
|
||||||
"jsmediatags": "^3.8.1",
|
"jsmediatags": "^3.8.1",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||||
"lbry-redux": "lbryio/lbry-redux#009ae8b8fac991c306179b66ac76066e92e16322",
|
"lbry-redux": "lbryio/lbry-redux#cf4bf4c4896d300827c7e07cdf17ca669394fcc4",
|
||||||
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
|
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
|
||||||
"lint-staged": "^7.0.2",
|
"lint-staged": "^7.0.2",
|
||||||
"localforage": "^1.7.1",
|
"localforage": "^1.7.1",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React, { useEffect, Fragment } from 'react';
|
import React, { useEffect, Fragment } from 'react';
|
||||||
import { CHANNEL_NEW, CHANNEL_ANONYMOUS } from 'constants/claim';
|
import { CHANNEL_NEW, CHANNEL_ANONYMOUS } from 'constants/claim';
|
||||||
import { buildURI, THUMBNAIL_STATUSES } from 'lbry-redux';
|
import { buildURI, isURIValid, THUMBNAIL_STATUSES } from 'lbry-redux';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import ChannelSection from 'component/selectChannel';
|
import ChannelSection from 'component/selectChannel';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
@ -112,7 +112,8 @@ function PublishForm(props: Props) {
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri) {
|
const isValid = isURIValid(uri);
|
||||||
|
if (uri && isValid) {
|
||||||
resolveUri(uri);
|
resolveUri(uri);
|
||||||
updatePublishForm({ uri });
|
updatePublishForm({ uri });
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ function PublishName(props: Props) {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
nameError = __('A name is required');
|
nameError = __('A name is required');
|
||||||
} else if (!isNameValid(name, false)) {
|
} else if (!isNameValid(name, false)) {
|
||||||
nameError = __('LBRY names cannot contain that symbol ($, #, @)');
|
nameError = __('LBRY names cannot contain spaces or reserved symbols ($#@;/"<>%{}|^~[]`)');
|
||||||
}
|
}
|
||||||
|
|
||||||
setNameError(nameError);
|
setNameError(nameError);
|
||||||
|
|
|
@ -36,7 +36,11 @@ function SelectAsset(props: Props) {
|
||||||
|
|
||||||
function doUploadAsset(filePath, thumbnailBuffer) {
|
function doUploadAsset(filePath, thumbnailBuffer) {
|
||||||
let thumbnail, fileExt, fileName, fileType;
|
let thumbnail, fileExt, fileName, fileType;
|
||||||
// @if TARGET='app'
|
if (IS_WEB) {
|
||||||
|
console.error('no upload support for web');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
thumbnail = fs.readFileSync(filePath);
|
thumbnail = fs.readFileSync(filePath);
|
||||||
fileExt = path.extname(filePath);
|
fileExt = path.extname(filePath);
|
||||||
|
@ -50,7 +54,6 @@ function SelectAsset(props: Props) {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// @endif
|
|
||||||
|
|
||||||
const uploadError = (error = '') => {
|
const uploadError = (error = '') => {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
|
|
Loading…
Add table
Reference in a new issue