Skip to content

Commit

Permalink
Fixing the issue of license activation through configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ircfspace committed Dec 23, 2024
1 parent 2691528 commit f4ee960
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/renderer/components/Modal/Profile/useProfileModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ const useProfileModal = (props: ProfileModalProps) => {
}, [onClose]);

const onSaveModal = useCallback(() => {
if (profileName !== '' && validEndpoint(profileEndpoint) && profileEndpoint.length > 7) {
if (
profileName !== '' &&
validEndpoint(profileEndpoint) !== '' &&
profileEndpoint.length > 7
) {
handleAddProfile();
} else {
settings.set('profiles', JSON.stringify(profilesInput));
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/lib/inputSanitizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const validEndpoint = (value: string) => {
};

export const newProfile = (savedProfiles: any, newName: string, newEndpoint: string) => {
if (!validEndpoint(newEndpoint) && newEndpoint !== defaultSettings.endpoint) {
if (validEndpoint(newEndpoint) !== '' && newEndpoint === defaultSettings.endpoint) {
return false;
}
if (!Array.isArray(savedProfiles)) {
Expand Down Expand Up @@ -146,7 +146,7 @@ export const parseEndpointConfig = (pastedText: string): ConfigType | null => {
pastedText = pastedText.toLowerCase();
const match = /^oblivion:\/\/endpoint@([^#]*)$/i.exec(pastedText);
if (!match) return null;
if (!validEndpoint(match[1])) {
if (validEndpoint(match[1]) === '') {
return null;
}
const endpoint = match[1] || defaultSettings.endpoint;
Expand Down

0 comments on commit f4ee960

Please sign in to comment.