mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
FIX: wallets from keychain were not being loaded
This commit is contained in:
parent
b2d9f8db0f
commit
2d332f8745
@ -25,6 +25,11 @@ class WatchDataSource: NSObject, WCSessionDelegate {
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
if let existingData = keychain.getData(Wallet.identifier), let walletData = ((try? NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(existingData) as? [Wallet]) as [Wallet]??) {
|
||||
guard let walletData = walletData, walletData != self.wallets else { return }
|
||||
wallets = walletData
|
||||
WatchDataSource.postDataUpdatedNotification()
|
||||
}
|
||||
if WCSession.isSupported() {
|
||||
print("Activating watch session")
|
||||
WCSession.default.delegate = self
|
||||
@ -123,11 +128,6 @@ class WatchDataSource: NSObject, WCSessionDelegate {
|
||||
|
||||
func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
|
||||
if activationState == .activated {
|
||||
if let existingData = keychain.getData(Wallet.identifier), let walletData = ((try? NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(existingData) as? [Wallet]) as [Wallet]??) {
|
||||
guard let walletData = walletData, walletData != self.wallets else { return }
|
||||
wallets = walletData
|
||||
WatchDataSource.postDataUpdatedNotification()
|
||||
}
|
||||
WCSession.default.sendMessage(["message" : "sendApplicationContext"], replyHandler: { (replyData) in
|
||||
}) { (error) in
|
||||
print(error)
|
||||
|
Loading…
Reference in New Issue
Block a user