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
bf7f8364
Commit
bf7f8364
authored
Jan 31, 2020
by
Akinwale Ariwodola
Browse files
fix search restore and background play bug
parent
017787ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/page/search/index.js
View file @
bf7f8364
...
...
@@ -35,7 +35,7 @@ const perform = dispatch => ({
search
:
(
query
,
from
)
=>
dispatch
(
doResolvedSearch
(
query
,
Constants
.
DEFAULT_PAGE_SIZE
,
from
,
false
,
{})),
claimSearch
:
options
=>
dispatch
(
doClaimSearch
(
options
)),
updateSearchQuery
:
query
=>
dispatch
(
doUpdateSearchQuery
(
query
)),
pushDrawerStack
:
()
=>
dispatch
(
doPushDrawerStack
(
Constants
.
DRAWER_ROUTE_SEARCH
)),
pushDrawerStack
:
(
routeName
,
params
)
=>
dispatch
(
doPushDrawerStack
(
routeName
,
params
)),
resolveUris
:
uris
=>
dispatch
(
doResolveUris
(
uris
)),
setPlayerVisible
:
()
=>
dispatch
(
doSetPlayerVisible
(
false
)),
});
...
...
src/page/search/view.js
View file @
bf7f8364
...
...
@@ -52,9 +52,9 @@ class SearchPage extends React.PureComponent {
}
onComponentFocused
=
()
=>
{
const
{
pushDrawerStack
,
setPlayerVisible
,
query
,
search
}
=
this
.
props
;
pushDrawerStack
();
const
{
pushDrawerStack
,
setPlayerVisible
,
navigation
,
query
,
search
}
=
this
.
props
;
setPlayerVisible
();
pushDrawerStack
(
Constants
.
DRAWER_ROUTE_SEARCH
,
navigation
.
state
.
params
?
navigation
.
state
.
params
:
null
);
NativeModules
.
Firebase
.
setCurrentScreen
(
'
Search
'
).
then
(
result
=>
{
const
searchQuery
=
query
||
this
.
getSearchQuery
();
if
(
searchQuery
&&
searchQuery
.
trim
().
length
>
0
)
{
...
...
@@ -221,32 +221,31 @@ class SearchPage extends React.PureComponent {
<
/View
>
)}
{(
!
isSearching
||
this
.
state
.
currentFrom
>
0
)
&&
(
<
FlatList
extraData
=
{
this
.
state
}
style
=
{
searchStyle
.
scrollContainer
}
contentContainerStyle
=
{
searchStyle
.
scrollPadding
}
keyboardShouldPersistTaps
=
{
'
handled
'
}
data
=
{
results
}
keyExtractor
=
{(
item
,
index
)
=>
item
.
claimId
}
initialNumToRender
=
{
10
}
maxToRenderPerBatch
=
{
20
}
onEndReached
=
{
this
.
handleVerticalEndReached
}
onEndReachedThreshold
=
{
0.2
}
removeClippedSubviews
ListEmptyComponent
=
{
!
isSearching
?
this
.
listEmptyComponent
()
:
null
}
ListHeaderComponent
=
{
this
.
listHeaderComponent
(
this
.
state
.
showTagResult
,
this
.
state
.
currentQuery
)}
renderItem
=
{({
item
})
=>
(
<
ClaimResultItem
key
=
{
item
.
claimId
}
uri
=
{
item
?
normalizeURI
(
`
${
item
.
name
}
#
${
item
.
claimId
}
`
)
:
null
}
result
=
{
item
}
style
=
{
searchStyle
.
resultItem
}
navigation
=
{
navigation
}
/
>
)}
/
>
)}
<
FlatList
extraData
=
{
this
.
state
}
style
=
{
searchStyle
.
scrollContainer
}
contentContainerStyle
=
{
searchStyle
.
scrollPadding
}
keyboardShouldPersistTaps
=
{
'
handled
'
}
data
=
{
results
}
keyExtractor
=
{(
item
,
index
)
=>
item
.
claimId
}
initialNumToRender
=
{
10
}
maxToRenderPerBatch
=
{
20
}
onEndReached
=
{
this
.
handleVerticalEndReached
}
onEndReachedThreshold
=
{
0.2
}
removeClippedSubviews
ListEmptyComponent
=
{
!
isSearching
?
this
.
listEmptyComponent
()
:
null
}
ListHeaderComponent
=
{
this
.
listHeaderComponent
(
this
.
state
.
showTagResult
,
this
.
state
.
currentQuery
)}
renderItem
=
{({
item
})
=>
(
<
ClaimResultItem
key
=
{
item
.
claimId
}
uri
=
{
item
?
normalizeURI
(
`
${
item
.
name
}
#
${
item
.
claimId
}
`
)
:
null
}
result
=
{
item
}
style
=
{
searchStyle
.
resultItem
}
navigation
=
{
navigation
}
/
>
)}
/
>
{
this
.
state
.
currentFrom
>
0
&&
isSearching
&&
(
<
View
style
=
{
searchStyle
.
moreLoading
}
>
<
ActivityIndicator
size
=
"
small
"
color
=
{
Colors
.
NextLbryGreen
}
/
>
...
...
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