File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,19 @@ const loadXpackStatic = () => {
3838 return Promise . resolve ( )
3939 }
4040 const url = '/xpack_static/license-generator.umd.js'
41- return request . loadRemoteScript ( url , 'sqlbot_xpack_static' , ( ) => {
42- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
43- // @ts -ignore
44- LicenseGenerator ?. init ( import . meta. env . VITE_API_BASE_URL )
41+ return new Promise ( ( resolve , reject ) => {
42+ request
43+ . loadRemoteScript ( url , 'sqlbot_xpack_static' , ( ) => {
44+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
45+ // @ts -ignore
46+ LicenseGenerator ?. init ( import . meta. env . VITE_API_BASE_URL ) . then ( ( ) => {
47+ resolve ( true )
48+ } )
49+ } )
50+ . catch ( ( error ) => {
51+ console . error ( 'Failed to load xpack_static script:' , error )
52+ ElMessage . error ( 'Failed to load license generator script' )
53+ reject ( error )
54+ } )
4555 } )
4656}
You can’t perform that action at this time.
0 commit comments