             # breaks the iframe layout.
             @forceIframeRendering()
 
-    ### Configuration ###
+
+    # If an application is broken, removed or updating, its corresponding
+    # iframe is removed.
+    onAppStateChanged: (appState) ->
+        if appState.status in ['updating', 'broken', 'uninstalled']
+            frame = @getAppFrame appState.slug
+            frame.remove()
 
 
     # Ugly trick for redrawing iframes. It's required because sometimes the

        , 10



    getAppFrame: (slug) ->
        return @$("##{slug}-frame")


    # If an application is broken, removed or updating, its corresponding
    # iframe is removed.
    onAppStateChanged: (appState) ->
        if appState.status in ['updating', 'broken', 'uninstalled']
            frame = @getAppFrame appState.slug
            frame.remove()


        super


    # Initialize all views, register main widgets and ensure that currently
    # displayed iframe is rerendered to be rendered properly after everything
    # is loaded.
    afterRender: =>
        @navbar = new NavbarView @apps, @notifications
        @applicationListView = new ApplicationsListView @apps, @market
