diff --git a/app/renderer/components/Screens/Account/LoggedIn/SessionIdEditor/SessionIdEditor.js b/app/renderer/components/Screens/Account/LoggedIn/SessionIdEditor/SessionIdEditor.js index 48f8d7f1..c3e68685 100644 --- a/app/renderer/components/Screens/Account/LoggedIn/SessionIdEditor/SessionIdEditor.js +++ b/app/renderer/components/Screens/Account/LoggedIn/SessionIdEditor/SessionIdEditor.js @@ -11,7 +11,7 @@ import ButtonWithSuccessIcon from "../../../../UI/ButtonWithSuccessIcon/ButtonWi const sessionIdEditor = () => { const [poeSessionId, setPoeSessionId] = useState( - globalStore.get(storeKeys.POE_SESSION_ID, null) + globalStore.get(storeKeys.POE_SESSION_ID) ); const [ successIconIsVisible, @@ -19,10 +19,14 @@ const sessionIdEditor = () => { hideSuccessIconAfterMsElapsed, ] = customHooks.useDisplay(); + function idIsDefined() { + return poeSessionId !== "" && typeof poeSessionId !== "undefined"; + } + function onSave() { globalStore.set( storeKeys.POE_SESSION_ID, - poeSessionId === "" ? null : poeSessionId + idIsDefined() ? poeSessionId : null ); displaySuccessIcon();