diff --git a/native/markdown/markdown-spoiler.react.js b/native/markdown/markdown-spoiler.react.js --- a/native/markdown/markdown-spoiler.react.js +++ b/native/markdown/markdown-spoiler.react.js @@ -32,10 +32,12 @@ const parsedSpoilerIdentifier = spoilerIdentifier ? parseInt(spoilerIdentifier) - : -1; + : null; const isRevealed = - (messageKey && spoilerRevealed[messageKey]?.[parsedSpoilerIdentifier]) ?? + (messageKey && + parsedSpoilerIdentifier !== null && + spoilerRevealed[messageKey]?.[parsedSpoilerIdentifier]) ?? false; const styleBasedOnSpoilerState = React.useMemo(() => { @@ -50,7 +52,7 @@ return; } - if (messageKey && parsedSpoilerIdentifier !== -1) { + if (messageKey && parsedSpoilerIdentifier !== null) { setSpoilerRevealed({ ...spoilerRevealed, [messageKey]: {