Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lbry
lbry-react-native
Commits
3717a807
Commit
3717a807
authored
Jan 20, 2020
by
Akinwale Ariwodola
Browse files
error on publish to existing content address
parent
46bfbd24
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/page/publish/index.js
View file @
3717a807
import
{
connect
}
from
'
react-redux
'
;
import
{
doPublish
,
doFetchClaimListMine
,
doResolveUri
,
doToast
,
doUpdatePublishForm
,
...
...
@@ -27,6 +28,7 @@ const select = state => ({
const
perform
=
dispatch
=>
({
notify
:
data
=>
dispatch
(
doToast
(
data
)),
clearPublishFormState
:
()
=>
dispatch
(
doClearPublishFormState
()),
fetchMyClaims
:
()
=>
dispatch
(
doFetchClaimListMine
()),
pendingPublishSuccess
:
pendingClaim
=>
dispatch
(
doPendingPublishSuccess
(
pendingClaim
)),
updatePublishForm
:
value
=>
dispatch
(
doUpdatePublishForm
(
value
)),
updatePublishFormState
:
data
=>
dispatch
(
doUpdatePublishFormState
(
data
)),
...
...
@@ -39,5 +41,5 @@ const perform = dispatch => ({
export
default
connect
(
select
,
perform
perform
,
)(
PublishPage
);
src/page/publish/view.js
View file @
3717a807
...
...
@@ -209,7 +209,7 @@ class PublishPage extends React.PureComponent {
};
onComponentFocused
=
()
=>
{
const
{
balance
,
hasFormState
,
pushDrawerStack
,
setPlayerVisible
,
navigation
}
=
this
.
props
;
const
{
balance
,
fetchMyClaims
,
hasFormState
,
pushDrawerStack
,
setPlayerVisible
,
navigation
}
=
this
.
props
;
NativeModules
.
Firebase
.
setCurrentScreen
(
'
Publish
'
).
then
(
result
=>
{
pushDrawerStack
(
Constants
.
DRAWER_ROUTE_PUBLISH
,
navigation
.
state
.
params
?
navigation
.
state
.
params
:
null
);
setPlayerVisible
();
...
...
@@ -219,6 +219,7 @@ class PublishPage extends React.PureComponent {
NativeModules
.
Gallery
.
canUseCamera
().
then
(
canUseCamera
=>
this
.
setState
({
canUseCamera
}));
NativeModules
.
Gallery
.
getThumbnailPath
().
then
(
thumbnailPath
=>
this
.
setState
({
thumbnailPath
}));
fetchMyClaims
();
NativeModules
.
UtilityModule
.
canReadWriteStorage
().
then
(
canReadWrite
=>
{
if
(
!
canReadWrite
)
{
...
...
@@ -356,7 +357,7 @@ class PublishPage extends React.PureComponent {
};
handlePublishPressed
=
()
=>
{
const
{
balance
,
notify
,
publish
,
updatePublishForm
}
=
this
.
props
;
const
{
balance
,
myClaims
,
notify
,
publish
,
updatePublishForm
}
=
this
.
props
;
const
{
editMode
,
bid
,
...
...
@@ -400,6 +401,14 @@ class PublishPage extends React.PureComponent {
if
(
!
isNameValid
(
name
,
false
))
{
notify
({
message
:
__
(
'
Your content address contains invalid characters.
'
),
isError
:
true
});
return
;
}
else
if
(
myClaims
&&
myClaims
.
length
>
0
)
{
if
(
myClaims
.
some
(
claim
=>
claim
.
name
.
toLowerCase
()
===
name
.
trim
().
toLowerCase
()))
{
notify
({
message
:
__
(
'
You have already published to the specified content address. Please enter a new address.
'
),
isError
:
true
,
});
return
;
}
}
if
(
!
currentMedia
&&
!
editMode
)
{
...
...
@@ -628,7 +637,7 @@ class PublishPage extends React.PureComponent {
}
}
else
{
// could not determine the file path
notify
({
message
:
__
(
'
The path could not be determined. Please try a different file.
'
)
});
notify
({
message
:
__
(
'
The path could not be determined. Please try a different file.
'
)
,
isError
:
true
});
}
};
...
...
src/page/splash/view.js
View file @
3717a807
...
...
@@ -59,10 +59,12 @@ class SplashScreen extends React.PureComponent {
}
else
if
(
lastRouteInStack
)
{
// no launch url, check if there's a last route in stack to navigate to.
const
{
route
,
params
}
=
lastRouteInStack
;
if
(
!
DrawerRoutes
.
includes
(
route
)
&&
isURIValid
(
route
))
{
navigateToUri
(
navigation
,
route
);
}
else
{
navigation
.
navigate
({
routeName
:
route
,
params
});
if
(
route
)
{
if
(
!
DrawerRoutes
.
includes
(
route
)
&&
isURIValid
(
route
))
{
navigateToUri
(
navigation
,
route
);
}
else
{
navigation
.
navigate
({
routeName
:
route
,
params
});
}
}
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment