Commit b04f723f authored by Evan You's avatar Evan You

only set lastUdpated if value is present

parent f58f941f
...@@ -51,7 +51,7 @@ function fetch (child) { ...@@ -51,7 +51,7 @@ function fetch (child) {
api.child(child).once('value', snapshot => { api.child(child).once('value', snapshot => {
const val = snapshot.val() const val = snapshot.val()
// mark the timestamp when this item is cached // mark the timestamp when this item is cached
val.__lastUpdated = Date.now() if (val) val.__lastUpdated = Date.now()
cache && cache.set(child, val) cache && cache.set(child, val)
resolve(val) resolve(val)
}, reject) }, reject)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment