                 @push_state('search/' + store.current_path)
             when 'settings'
                 @push_state('settings')
-            else #editor...
+            else # editor...
                 path = misc.tab_to_path(key)
                 @redux.getActions('file_use')?.mark_file(@project_id, path, 'open')
                 @push_state('files/' + path)
                 @set_current_path(misc.path_split(path).head)
-                if redux.getStore('projects').get_my_group(@project_id) != store.open_files.getIn([path, 'component']).is_public
+
+                # Reopen the file if relationship has changed
+                is_public = redux.getStore('projects').get_my_group(@project_id) == 'public'
+                was_public = store.open_files.getIn([path, 'component']).is_public
+                if is_public != was_public
                     @open_file(path : path)
-                    # Reopen the file if relationship has changed
+
 
     add_a_ghost_file_tab: () =>
         current_num = @get_store().num_ghost_file_tabs

                if target[target.length-1] == '/' or full_path == ''
                    @open_directory(parent_path)
                else
                    @fetch_directory_listing(parent_path, true, true)
                    @get_store().wait
                        until   : (s) =>

                    hidden     : show_hidden
                    max_time_s : 4*60  # keep trying for up to 4 minutes
                    group      : group
                    cb         : cb
        ], (err, listing) =>
            @set_activity(id:id, stop:'')
            # Update the path component of the immutable directory listings map:
            store = @get_store()
