Skip to content

Commit

Permalink
Added background subscription upadte failed toast and removed home pa…
Browse files Browse the repository at this point in the history
…ge refresh when older than a minute.
  • Loading branch information
usertoroot committed Sep 5, 2024
1 parent de5a4aa commit 44a6e5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,9 @@ class HomeFragment : MainFragment() {

val feedstyleChanged = recyclerData.loadedFeedStyle != feedStyle;
val clientsChanged = lastClients == null || lastClients.size != clients.size || !lastClients.containsAll(clients);
val outdated = recyclerData.lastLoad.getNowDiffSeconds() > 60;
Logger.i(TAG, "onShown (recyclerData.loadedFeedStyle=${recyclerData.loadedFeedStyle}, recyclerData.lastLoad=${recyclerData.lastLoad}, feedstyleChanged=$feedstyleChanged, clientsChanged=$clientsChanged, outdated=$outdated)")
Logger.i(TAG, "onShown (recyclerData.loadedFeedStyle=${recyclerData.loadedFeedStyle}, recyclerData.lastLoad=${recyclerData.lastLoad}, feedstyleChanged=$feedstyleChanged, clientsChanged=$clientsChanged)")

if(feedstyleChanged || outdated || clientsChanged) {
if(feedstyleChanged || clientsChanged) {
recyclerData.lastLoad = OffsetDateTime.now();
recyclerData.loadedFeedStyle = feedStyle;
recyclerData.lastClients = clients;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ class StateApp {
wm.cancelAllWork();
} catch (e: Throwable) {
Logger.e(TAG, "Failed to schedule background subscription updates.", e)
UIDialogs.toast(context, "Background subscription update failed: " + e.message)
}
}

Expand Down

0 comments on commit 44a6e5d

Please sign in to comment.