File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -937,25 +937,27 @@ async function clickAnalysis(id?: number) {
937937
938938function getRecordUsage(recordId : any ) {
939939 console .debug (' getRecordUsage id: ' , recordId )
940- nextTick (() => {
941- chatApi
942- .get_chart_usage (recordId )
943- .then ((res ) => {
944- const logHistory = chatApi .toChatLogHistory (res )
945- if (logHistory ) {
946- currentChat .value .records .forEach ((record ) => {
947- if (record .id === recordId ) {
948- record .duration = logHistory .duration
949- record .finish_time = logHistory .finish_time
950- record .total_tokens = logHistory .total_tokens
951- }
952- })
953- }
954- })
955- .catch ((e ) => {
956- console .error (e )
957- })
958- })
940+ if (recordId ) {
941+ nextTick (() => {
942+ chatApi
943+ .get_chart_usage (recordId )
944+ .then ((res ) => {
945+ const logHistory = chatApi .toChatLogHistory (res )
946+ if (logHistory ) {
947+ currentChat .value .records .forEach ((record ) => {
948+ if (record .id === recordId ) {
949+ record .duration = logHistory .duration
950+ record .finish_time = logHistory .finish_time
951+ record .total_tokens = logHistory .total_tokens
952+ }
953+ })
954+ }
955+ })
956+ .catch ((e ) => {
957+ console .error (e )
958+ })
959+ })
960+ }
959961}
960962
961963const predictAnswerRef = ref ()
You can’t perform that action at this time.
0 commit comments