OdyseeTeam / odysee-ios

The Odysee iOS app with wallet functionality.
MIT License
69 stars 21 forks source link

State persists between logins #262

Open tzarebczan opened 2 years ago

tzarebczan commented 2 years ago

Logged out of account A, logged into account B . Following showed from Account A.

tzarebczan commented 2 years ago

Restarting the app and it still persists, but now also shows the correct channels at the front.

ktprograms commented 2 years ago

I was able to "fix" this with this diff:

diff --git a/Odysee/Controllers/Content/FollowingViewController.swift b/Odysee/Controllers/Content/FollowingViewController.swift
index dc67b83..e91881a 100644
--- a/Odysee/Controllers/Content/FollowingViewController.swift
+++ b/Odysee/Controllers/Content/FollowingViewController.swift
@@ -89,6 +89,8 @@ class FollowingViewController: UIViewController, UICollectionViewDataSource, UIC
             if Lbryio.subscriptionsDirty {
                 loadLocalSubscriptions(true)
             } else {
+                Lbryio.cachedSubscriptions.removeAll()
+                syncCompleted()
                 loadRemoteSubscriptions()
             }

Basically, the sign up flow doesn't trigger the same wallet sync code path that

I don't think this is the best place to put this, but I wasn't able to understand enough of the code paths to figure out where best to put it.

@akinwale Can you please suggest where it should go?