Skip to content

Commit f4ee960

Browse files
committed
Fixing the issue of license activation through configuration
1 parent 2691528 commit f4ee960

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/renderer/components/Modal/Profile/useProfileModal.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ const useProfileModal = (props: ProfileModalProps) => {
9292
}, [onClose]);
9393

9494
const onSaveModal = useCallback(() => {
95-
if (profileName !== '' && validEndpoint(profileEndpoint) && profileEndpoint.length > 7) {
95+
if (
96+
profileName !== '' &&
97+
validEndpoint(profileEndpoint) !== '' &&
98+
profileEndpoint.length > 7
99+
) {
96100
handleAddProfile();
97101
} else {
98102
settings.set('profiles', JSON.stringify(profilesInput));

src/renderer/lib/inputSanitizer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const validEndpoint = (value: string) => {
4949
};
5050

5151
export const newProfile = (savedProfiles: any, newName: string, newEndpoint: string) => {
52-
if (!validEndpoint(newEndpoint) && newEndpoint !== defaultSettings.endpoint) {
52+
if (validEndpoint(newEndpoint) !== '' && newEndpoint === defaultSettings.endpoint) {
5353
return false;
5454
}
5555
if (!Array.isArray(savedProfiles)) {
@@ -146,7 +146,7 @@ export const parseEndpointConfig = (pastedText: string): ConfigType | null => {
146146
pastedText = pastedText.toLowerCase();
147147
const match = /^oblivion:\/\/endpoint@([^#]*)$/i.exec(pastedText);
148148
if (!match) return null;
149-
if (!validEndpoint(match[1])) {
149+
if (validEndpoint(match[1]) === '') {
150150
return null;
151151
}
152152
const endpoint = match[1] || defaultSettings.endpoint;

0 commit comments

Comments
 (0)