         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


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


mark_visible_notifications = (mark) ->
    set = {}; set[mark] = true
    if not notifications_syncdb?
        return
    for x in notifications_syncdb.select(where:{table:'activity'})
        if not x[mark]
            elt = notification_elements["#{x.project_id}/#{x.path}"]
