A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Only scroll to top when the search term or playlist changes

+21 -11
+21 -11
src/Applications/UI/Tracks.elm
··· 519 519 520 520 521 521 resolveParcel : Model -> Parcel -> Return Model Msg UI.Reply 522 - resolveParcel model ( _, newCollection ) = 522 + resolveParcel model ( deps, newCollection ) = 523 523 let 524 524 scrollObj = 525 525 Json.Encode.object ··· 529 529 Json.Encode.object 530 530 [ ( "target", scrollObj ) ] 531 531 532 + newScrollContext = 533 + scrollContext model 534 + 532 535 collectionChanged = 533 536 Collection.tracksChanged 534 537 model.collection.untouched 535 538 newCollection.untouched 536 539 537 540 harvestChanged = 538 - if collectionChanged then 539 - True 541 + Collection.harvestChanged 542 + model.collection.harvested 543 + newCollection.harvested 540 544 541 - else 542 - Collection.harvestChanged 543 - model.collection.harvested 544 - newCollection.harvested 545 + searchChanged = 546 + newScrollContext /= model.collection.scrollContext 545 547 546 548 listSceneModel = 547 549 model.listScene 548 550 549 551 listScene = 550 - if harvestChanged && model.scene == List then 552 + if model.scene == List && searchChanged then 551 553 { listSceneModel | infiniteList = InfiniteList.updateScroll scrollEvent listSceneModel.infiniteList } 552 554 553 555 else ··· 555 557 556 558 modelWithNewCollection = 557 559 { model 558 - | collection = newCollection 560 + | collection = { newCollection | scrollContext = newScrollContext } 559 561 , listScene = listScene 560 562 , selectedTrackIndexes = 561 - if harvestChanged then 563 + if collectionChanged || harvestChanged then 562 564 [] 563 565 564 566 else ··· 569 571 ---------- 570 572 -- Command 571 573 ---------- 572 - , if harvestChanged then 574 + , if searchChanged then 573 575 case model.scene of 574 576 List -> 575 577 Cmd.map ListSceneMsg UI.Tracks.Scene.List.scrollToTop ··· 596 598 |> makeParcel 597 599 |> collector 598 600 |> resolveParcel model 601 + 602 + 603 + scrollContext : Model -> String 604 + scrollContext model = 605 + String.concat 606 + [ Maybe.withDefault "" <| model.searchTerm 607 + , Maybe.withDefault "" <| Maybe.map .name model.selectedPlaylist 608 + ] 599 609 600 610 601 611