mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
use sync.getActiveLinkedServices()
This commit is contained in:
parent
6efa8fcbde
commit
01dae8e5ab
@ -247,8 +247,6 @@ const SearchResults = ({
|
||||
|
||||
export default (props) => {
|
||||
const [searchResults, setSearchResults] = React.useState(false)
|
||||
const [loading, setLoading] = React.useState(true)
|
||||
const [hasTidal, setHasTidal] = React.useState(false)
|
||||
|
||||
React.useEffect(() => {
|
||||
app.layout.toggleCenteredContent(true)
|
||||
@ -259,16 +257,6 @@ export default (props) => {
|
||||
}
|
||||
})
|
||||
|
||||
SyncModel.hasServiceLinked("tidal")
|
||||
.catch(() => {
|
||||
setHasTidal(false)
|
||||
setLoading(false)
|
||||
})
|
||||
.then((value) => {
|
||||
setHasTidal(value.active)
|
||||
setLoading(false)
|
||||
})
|
||||
|
||||
return () => {
|
||||
if (app.layout.page_panels) {
|
||||
app.layout.page_panels.detachComponent("music_navbar")
|
||||
@ -276,10 +264,6 @@ export default (props) => {
|
||||
}
|
||||
}, [])
|
||||
|
||||
if (loading) {
|
||||
return null
|
||||
}
|
||||
|
||||
return <div
|
||||
className={classnames(
|
||||
"musicExplorer",
|
||||
@ -291,7 +275,7 @@ export default (props) => {
|
||||
renderResults={false}
|
||||
model={MusicModel.search}
|
||||
modelParams={{
|
||||
useTidal: hasTidal,
|
||||
useTidal: app.cores.sync.getActiveLinkedServices().tidal,
|
||||
}}
|
||||
onSearchResult={setSearchResults}
|
||||
onEmpty={() => setSearchResults(false)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user