Skip to content

Commit

Permalink
Add idIsDefined to SessionIdEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
gomorizsolt committed Sep 11, 2019
1 parent 4ee7d33 commit e84368a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ 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,
displaySuccessIcon,
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();
Expand Down

0 comments on commit e84368a

Please sign in to comment.