File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
src/web/src/views/workspace/components Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import WSEditorCommandGroupContent from "../WSEditorCommandGroupContent";
99import WSEditorCommandContent from "../WSEditorCommandContent" ;
1010import WSEditorClientConfigDialog from "./WSEditorClientConfig" ;
1111import type { CommandGroup , Command } from "../../interfaces" ;
12- import type { ClientConfig } from "../../../../services" ;
1312import WSEditorExportDialog from "./WSEditorExportDialog" ;
1413import WSEditorDeleteDialog from "./WSEditorDeleteDialog" ;
1514import WSEditorSwaggerReloadDialog from "./WSEditorSwaggerReloadDialog" ;
@@ -45,16 +44,20 @@ function WSEditor({ params }: WSEditorProps) {
4544 useEffect ( ( ) => {
4645 if ( ! workspace . reloadTimestamp ) return ;
4746
48- if ( workspace . clientConfigurable ) {
49- workspace
50- . getWorkspaceClientConfig ( workspace . workspaceUrl )
51- . then ( ( clientConfig : ClientConfig | null ) => {
47+ const checkClientConfig = async ( ) => {
48+ if ( workspace . clientConfigurable ) {
49+ try {
50+ const clientConfig = await workspace . getWorkspaceClientConfig ( workspace . workspaceUrl ) ;
5251 if ( ! clientConfig ) {
5352 dialogManager . openClientConfigDialog ( ) ;
5453 }
55- } )
56- . catch ( console . error ) ;
57- }
54+ } catch ( error ) {
55+ console . error ( error ) ;
56+ }
57+ }
58+ } ;
59+
60+ checkClientConfig ( ) ;
5861
5962 if ( workspace . commandTree . length === 0 ) {
6063 dialogManager . openSwaggerResourcePicker ( ) ;
Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ const WSEditorCommandContent: React.FC<WSEditorCommandContentProps> = ({
101101
102102 useEffect ( ( ) => {
103103 const loadCommand = async ( ) => {
104- const requestKey = `${ previewCommand . id } -${ reloadTimestamp } ` ;
104+ const requestKey = `${ workspaceUrl } - ${ previewCommand . id } -${ reloadTimestamp } ` ;
105105
106- if ( lastLoadRef . current === requestKey || loading ) {
106+ if ( lastLoadRef . current === requestKey ) {
107107 return ;
108108 }
109109
You can’t perform that action at this time.
0 commit comments