         update_important_count(false)
 
 delete_oldest_notification = () ->
+    if not notifications_syncdb?
+        return
     v = notifications_syncdb.select(where:{table:'activity'})
     v.sort(misc.timestamp_cmp)
     if v.length > 0

    #console.log("render_notifications")
    notification_list_body.empty()
    important_count = 0
    v = notifications_syncdb.select(where:{table:'activity'})
    v.sort(misc.timestamp_cmp)
    ensure_titles_and_user_names v, () =>


update_notifications = (changes) ->
    #console.log("update_notifications: #{misc.to_json(changes)}")
    if not notifications_syncdb?
        return
    for c in changes
        if c.insert?
            render_notification(c.insert)
