Skip to content

Commit d9ebd04

Browse files
author
katowulf
authored
Fix promise chain in count-sample
Fixes #94
1 parent 46c8787 commit d9ebd04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

child-count/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ exports.recountlikes = functions.database.ref("/posts/{postid}/likes_count").onW
3939
if (!event.data.exists()) {
4040
var counterRef = event.data.ref;
4141
var collectionRef = counterRef.parent.child('likes');
42-
return collectionRef.once('value', function(messagesData) {
42+
return collectionRef.once('value').then(function(messagesData) {
4343
return counterRef.set(messagesData.numChildren());
4444
});
4545
}

0 commit comments

Comments
 (0)