Skip to content

Commit

Permalink
address fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisDemyanko committed Aug 23, 2022
1 parent 948c639 commit 89470aa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
4 changes: 2 additions & 2 deletions BeamWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5108,7 +5108,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Frameworks/boost",
);
MARKETING_VERSION = 7.0;
MARKETING_VERSION = 7.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -5182,7 +5182,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Frameworks/boost",
);
MARKETING_VERSION = 7.0;
MARKETING_VERSION = 7.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
21 changes: 16 additions & 5 deletions BeamWallet/BeamSDK/AppModel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
#include <sys/sysctl.h>
#import <sys/utsname.h>

//#import "BeamWallet-Swift.h"
#import "BeamWallet-Swift.h"
//#import "BeamWalletMasterNet-Swift.h"
#import "BeamWalletTestNet-Swift.h"
//#import "BeamWalletTestNet-Swift.h"

using namespace beam;
using namespace ECC;
Expand Down Expand Up @@ -1364,6 +1364,11 @@ -(void)deleteAddress:(NSString*_Nullable)address {
if (notificationId!=nil) {
[self deleteNotification:notificationId];
}

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self->wallet->getAsync()->getAddresses(true);
self->wallet->getAsync()->getAddresses(false);
});
}
else if([self isToken:address]) {
BMTransactionParameters *params = [[AppModel sharedManager] getTransactionParameters:address];
Expand Down Expand Up @@ -1766,7 +1771,9 @@ -(void)addContact:(NSString*_Nonnull)addressId address:(NSString*_Nullable)addre
savedAddress.m_duration = WalletAddress::AddressExpirationNever;
savedAddress.m_Address = address.string;
wallet->getAsync()->saveAddress(savedAddress);
wallet->getAsync()->getAddresses(false);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self->wallet->getAsync()->getAddresses(false);
});
}
else {
WalletID walletID(Zero);
Expand Down Expand Up @@ -1799,8 +1806,12 @@ -(void)addContact:(NSString*_Nonnull)addressId address:(NSString*_Nullable)addre
}
}
savedAddress.m_createTime = NSDate.date.timeIntervalSince1970;
walletDb->saveAddress(savedAddress);
wallet->getAsync()->getAddresses(false);
// walletDb->saveAddress(savedAddress);
wallet->getAsync()->saveAddress(savedAddress);

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self->wallet->getAsync()->getAddresses(false);
});
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions BeamWallet/BeamSDK/WalletModel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,15 @@

[contacts removeObjectsAtIndexes:set];

for(int j = 0; j < [contacts count]; j++){
for(int k = j+1;k < [contacts count];k++){
BMContact *str1 = [contacts objectAtIndex:j];
BMContact *str2 = [contacts objectAtIndex:k];
if([str1.address.identity isEqualToString:str2.address.identity]) {
[contacts removeObjectAtIndex:k];
}
}
}
// for(int j = 0; j < [contacts count]; j++){
// for(int k = j+1;k < [contacts count];k++){
// BMContact *str1 = [contacts objectAtIndex:j];
// BMContact *str2 = [contacts objectAtIndex:k];
// if([str1.address.identity isEqualToString:str2.address.identity]) {
// [contacts removeObjectAtIndex:k];
// }
// }
// }

[[AppModel sharedManager] setContacts:contacts];

Expand Down

0 comments on commit 89470aa

Please sign in to comment.