     (should-update [_ next-props next-state]
       (if (:editing? next-state)
         (or (not= (:doc-id next-props) (:doc-id (om/get-props owner)))
+            (not= (:max-document-scope next-props) (:max-document-scope (om/get-props owner)))
             (nil? (:local-doc-name next-state)))
         true))
     om/IRender


                     (keyword-identical? :start overlay-key)
                     (om/build doc-name {:doc-id (:document/id app)
                                         :doc-name (:doc-name app)})

                     (namespaced? overlay-key)
                     (str (:title component) " " (str/capitalize (name overlay-key)))

            (common/icon :login)
            [:span "Log in"]]))))))

(defn doc-name [{:keys [doc-id doc-name max-document-scope]} owner]
  (reify
    om/IDisplayName (display-name [_] "Doc name")
    om/IInitState (init-state [_] {:listener-key (.getNextUniqueId (.getInstance IdGenerator))})
