Skip to content

Commit f18f6eb

Browse files
committed
fix: reduce spurious contact-changed notifications
1 parent e3acc20 commit f18f6eb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contacts.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,11 @@ CNAuthorizationStatus AuthStatus() {
659659
addObserverForName:CNContactStoreDidChangeNotification
660660
object:nil
661661
queue:[NSOperationQueue mainQueue]
662-
usingBlock:^(NSNotification *note) {
662+
usingBlock:^(NSNotification *notification) {
663+
NSDictionary *info = [notification userInfo];
664+
if ([info count] == 0)
665+
return;
666+
663667
contacts_ref.Reset();
664668
auto callback = [](Napi::Env env, Napi::Function js_cb,
665669
const char *value) {

0 commit comments

Comments
 (0)