File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ const useProfileModal = (props: ProfileModalProps) => {
92
92
} , [ onClose ] ) ;
93
93
94
94
const onSaveModal = useCallback ( ( ) => {
95
- if ( profileName !== '' && validEndpoint ( profileEndpoint ) && profileEndpoint . length > 7 ) {
95
+ if (
96
+ profileName !== '' &&
97
+ validEndpoint ( profileEndpoint ) !== '' &&
98
+ profileEndpoint . length > 7
99
+ ) {
96
100
handleAddProfile ( ) ;
97
101
} else {
98
102
settings . set ( 'profiles' , JSON . stringify ( profilesInput ) ) ;
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export const validEndpoint = (value: string) => {
49
49
} ;
50
50
51
51
export const newProfile = ( savedProfiles : any , newName : string , newEndpoint : string ) => {
52
- if ( ! validEndpoint ( newEndpoint ) && newEndpoint ! == defaultSettings . endpoint ) {
52
+ if ( validEndpoint ( newEndpoint ) !== '' && newEndpoint = == defaultSettings . endpoint ) {
53
53
return false ;
54
54
}
55
55
if ( ! Array . isArray ( savedProfiles ) ) {
@@ -146,7 +146,7 @@ export const parseEndpointConfig = (pastedText: string): ConfigType | null => {
146
146
pastedText = pastedText . toLowerCase ( ) ;
147
147
const match = / ^ o b l i v i o n : \/ \/ e n d p o i n t @ ( [ ^ # ] * ) $ / i. exec ( pastedText ) ;
148
148
if ( ! match ) return null ;
149
- if ( ! validEndpoint ( match [ 1 ] ) ) {
149
+ if ( validEndpoint ( match [ 1 ] ) === '' ) {
150
150
return null ;
151
151
}
152
152
const endpoint = match [ 1 ] || defaultSettings . endpoint ;
You can’t perform that action at this time.
0 commit comments