File tree Expand file tree Collapse file tree 1 file changed +20
-17
lines changed
Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -934,23 +934,26 @@ async function clickAnalysis(id?: number) {
934934}
935935
936936function getRecordUsage(recordId : any ) {
937- chatApi
938- .get_chart_usage (recordId )
939- .then ((res ) => {
940- const logHistory = chatApi .toChatLogHistory (res )
941- if (logHistory ) {
942- currentChat .value .records .forEach ((record ) => {
943- if (record .id === recordId ) {
944- record .duration = logHistory .duration
945- record .finish_time = logHistory .finish_time
946- record .total_tokens = logHistory .total_tokens
947- }
948- })
949- }
950- })
951- .catch ((e ) => {
952- console .error (e )
953- })
937+ console .debug (' getRecordUsage id: ' , recordId )
938+ nextTick (() => {
939+ chatApi
940+ .get_chart_usage (recordId )
941+ .then ((res ) => {
942+ const logHistory = chatApi .toChatLogHistory (res )
943+ if (logHistory ) {
944+ currentChat .value .records .forEach ((record ) => {
945+ if (record .id === recordId ) {
946+ record .duration = logHistory .duration
947+ record .finish_time = logHistory .finish_time
948+ record .total_tokens = logHistory .total_tokens
949+ }
950+ })
951+ }
952+ })
953+ .catch ((e ) => {
954+ console .error (e )
955+ })
956+ })
954957}
955958
956959const predictAnswerRef = ref ()
You can’t perform that action at this time.
0 commit comments