@@ -52,6 +52,21 @@ const WBResults = (props: Props) => {
52
52
</ div >
53
53
)
54
54
55
+ const handleQueryProfile = (
56
+ profileType : ProfileQueryType ,
57
+ commandExecution : { command : string , mode ?: RunQueryMode , resultsMode ?: ResultsMode }
58
+ ) => {
59
+ const { command, mode, resultsMode } = commandExecution
60
+ const profileQuery = generateProfileQueryForCommand ( command , profileType )
61
+ if ( profileQuery ) {
62
+ onQueryProfile (
63
+ profileQuery ,
64
+ null ,
65
+ { mode, results : resultsMode , clearEditor : false , } ,
66
+ )
67
+ }
68
+ }
69
+
55
70
return (
56
71
< div className = { cx ( styles . container ) } >
57
72
< div ref = { scrollDivRef } />
@@ -90,16 +105,10 @@ const WBResults = (props: Props) => {
90
105
resultsMode = { resultsMode }
91
106
db = { db }
92
107
onQueryOpen = { ( ) => onQueryOpen ( id ) }
93
- onQueryProfile = { ( profileType : ProfileQueryType ) => {
94
- const profileQuery = generateProfileQueryForCommand ( command , profileType )
95
- if ( profileQuery ) {
96
- return onQueryProfile (
97
- profileQuery ,
98
- null ,
99
- { mode, results : resultsMode , clearEditor : false , } ,
100
- )
101
- }
102
- } }
108
+ onQueryProfile = { profileType => handleQueryProfile (
109
+ profileType ,
110
+ { command, mode, resultsMode } ,
111
+ ) }
103
112
onQueryReRun = { ( ) => onQueryReRun (
104
113
command ,
105
114
null ,
0 commit comments