mirror of
https://github.com/Kong/insomnia.git
synced 2026-11-02 03:00:25 -05:00
fix: handle invalid vault tag when there is no args set (#10663)
* handle invalid vault tag when no args is set * add a errorboundary
This commit is contained in:
1 parent
d94f8dbf72
commit
eecc5b004e
2 files changed
+4
-2
No files matched your search
@@ -7,6 +7,7 @@ import { Modal, type ModalHandle, type ModalProps } from '../base/modal';
|
||||
import { ModalBody } from '../base/modal-body';
|
||||
import { ModalFooter } from '../base/modal-footer';
|
||||
import { ModalHeader } from '../base/modal-header';
|
||||
import { ErrorBoundary } from '../error-boundary';
|
||||
import { TagEditor } from '../templating/tag-editor';
|
||||
import { VariableEditor } from '../templating/variable-editor';
|
||||
|
||||
@@ -57,6 +58,7 @@ export const NunjucksModal = forwardRef<NunjucksModalHandle, ModalProps & Props>
|
||||
editorId,
|
||||
onOpenSource,
|
||||
});
|
||||
setIsRendering(false);
|
||||
modalRef.current?.show();
|
||||
},
|
||||
}),
|
||||
@@ -114,7 +116,7 @@ export const NunjucksModal = forwardRef<NunjucksModalHandle, ModalProps & Props>
|
||||
modalRef.current?.hide();
|
||||
}}
|
||||
>
|
||||
{editor}
|
||||
<ErrorBoundary>{editor}</ErrorBoundary>
|
||||
</form>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ export const ExternalVaultForm = (props: ArgConfigFormProps) => {
|
||||
const formData = useMemo(() => {
|
||||
return JSON.parse(configValue) as ExternalVaultConfig;
|
||||
}, [configValue]);
|
||||
const selectedCredentialIdOrCredentialKey = activeTagData.args[1].value?.toString() || '';
|
||||
const selectedCredentialIdOrCredentialKey = activeTagData.args[1]?.value?.toString() || '';
|
||||
const isLegacyCredentialTag = models.cloudCredential.isCloudCredentialId(selectedCredentialIdOrCredentialKey);
|
||||
const selectedCredentialId = isLegacyCredentialTag
|
||||
? // legacy version to save cloud credential id in tag
|
||||
|
||||
Reference in new issue
Block a user