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
df3a9587
Commit
df3a9587
authored
Jan 17, 2020
by
Akinwale Ariwodola
Browse files
update fileGetStarted logic
parent
5df8b8c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/page/file/view.js
View file @
df3a9587
...
...
@@ -196,16 +196,18 @@ class FilePage extends React.PureComponent {
const
mediaType
=
Lbry
.
getMediaType
(
contentType
);
const
isPlayable
=
mediaType
===
'
video
'
||
mediaType
===
'
audio
'
;
if
(
this
.
state
.
fileGetStarted
||
prevPurchasedUris
.
length
!==
purchasedUris
.
length
)
{
const
{
permanent_url
:
permanentUrl
}
=
claim
;
if
(
purchasedUris
.
includes
(
uri
)
||
purchasedUris
.
includes
(
permanentUrl
))
{
const
{
nout
,
txid
}
=
claim
;
const
outpoint
=
`
${
txid
}
:
${
nout
}
`
;
const
{
permanent_url
:
permanentUrl
,
nout
,
txid
}
=
claim
;
const
outpoint
=
`
${
txid
}
:
${
nout
}
`
;
if
(
this
.
state
.
fileGetStarted
)
{
NativeModules
.
UtilityModule
.
queueDownload
(
outpoint
);
this
.
setState
({
fileGetStarted
:
false
});
}
if
(
purchasedUris
.
includes
(
uri
)
||
purchasedUris
.
includes
(
permanentUrl
))
{
// If the media is playable, file/view will be done in onPlaybackStarted
if
(
!
isPlayable
&&
!
this
.
state
.
fileViewLogged
)
{
this
.
logFileView
(
uri
,
claim
);
}
this
.
setState
({
fileGetStarted
:
false
});
}
NativeModules
.
UtilityModule
.
checkDownloads
();
}
...
...
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