Skip to content

Commit

Permalink
Fix refresh from LMS when shopwing sub items
Browse files Browse the repository at this point in the history
We call clearAndReorderItems on a refresh request. The previous
implementation for sub items did not order items, instead they were set
on handshake complete.
Now order page immediately set the (sub-)items, instead of requesting
the data.
  • Loading branch information
kaaholst committed Aug 16, 2024
1 parent 22e2bcd commit 2bcc07e
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ protected boolean needPlayer() {
@Override
protected void orderPage(@NonNull ISqueezeService service, int start) {
if (parent != null) {
if (action == null || (parent.hasInput() && !parent.isInputReady())) {
if (parent.hasSubItems()) {
onItemsReceived(parent.subItems.size(), 0, parent.subItems, JiveItem.class);
} else if (action == null || (parent.hasInput() && !parent.isInputReady())) {
showContent();
} else
service.pluginItems(start, parent, action, this);
Expand All @@ -353,14 +355,6 @@ protected void orderPage(@NonNull ISqueezeService service, int start) {
}
}

public void onEventMainThread(HandshakeComplete event) {
Log.d(TAG, "Handshake complete");
super.onEventMainThread(event);
if (parent != null && parent.hasSubItems()) {
getItemAdapter().update(parent.subItems.size(), 0, parent.subItems);
}
}

@MainThread
public void onEventMainThread(ActivePlayerChanged event) {
if (action != null && !forActivePlayer(action)) {
Expand Down

0 comments on commit 2bcc07e

Please sign in to comment.