                     window.localStorage.removeItem 'rethinkdb_history'
 
             @show_query_warning = @state.query isnt @state.current_query # Show a warning in case the displayed results are not the one of the query in code mirror
-            @current_results = @state.results
-            @profile = @state.profile
 
             # Index used to navigate through history with the keyboard
             @history_displayed_id = 0 # 0 means we are showing the draft, n>0 means we are showing the nth query in the history

    @state =
        current_query: null
        query: null
        results: null
        profile: null
        query_result: null
        metadata: null
        cursor_timed_out: true
        view: 'tree'
        history_state: 'hidden'


            if args? and args.results isnt undefined
                @results = args.results
                @ATN_results_array = null # if @results is not an array (possible starting from 1.4), we will transform @results_array to [@results] for the table view
            if args? and args.profile isnt undefined
                @ATN_profile = args.ATN_profile
            if args?.ATN_metadata?
                @ATN_metadata = args.ATN_metadata
            if args?.ATN_metadata?.skip_value?
                # @container.state.start_record is the old value of @container.state.skip_value
                # Here we just deal with start_record
                # TODO May have to remove this line as we have metadata.start now
                @container.state.start_record = args.ATN_metadata.skip_value

                if args.ATN_metadata.execution_time?
                    @ATN_metadata.execution_time_pretty = Utils.prettify_duration args.ATN_metadata.execution_time

            num_results = @ATN_metadata.skip_value
            if @ATN_metadata.has_more_data isnt true
                if Object::toString.call(@results) is '[object Array]'
                    num_results += @results.length
                else # @results can be a single value or null
                    num_results += 1

            @$el.html @template _.extend @ATN_metadata,
                show_query_warning: args?.show_query_warning
                show_more_data: @ATN_metadata.has_more_data is true and @container.state.cursor_timed_out is false
                cursor_timed_out_template: (@cursor_timed_out_template() if @ATN_metadata.has_more_data is true and @container.state.cursor_timed_out is true)
                execution_time_pretty: @ATN_metadata.execution_time_pretty
                no_results: @ATN_metadata.has_more_data isnt true and @results?.length is 0 and @ATN_metadata.skip_value is 0
                num_results: num_results

            @view_object?.remove()
