mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(reply modal): get mobile scroll position from hook before render
This commit is contained in:
@@ -24,7 +24,7 @@ const Board = () => {
|
||||
const subplebbit = useSubplebbit({ subplebbitAddress });
|
||||
const { createdAt, description, rules, shortAddress, state, suggested, title } = subplebbit || {};
|
||||
|
||||
const { showReplyModal, activeCid, openReplyModal, closeModal } = useReplyModal();
|
||||
const { activeCid, closeModal, openReplyModal, showReplyModal, scrollY } = useReplyModal();
|
||||
|
||||
const loadingStateString = useFeedStateString(subplebbitAddresses) || t('loading');
|
||||
const loadingString = <div className={styles.stateString}>{state === 'failed' ? state : <LoadingEllipsis string={loadingStateString} />}</div>;
|
||||
@@ -62,7 +62,7 @@ const Board = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.content}>
|
||||
{showReplyModal && activeCid && <ReplyModal closeModal={closeModal} parentCid={activeCid} />}
|
||||
{showReplyModal && activeCid && <ReplyModal closeModal={closeModal} parentCid={activeCid} scrollY={scrollY} />}
|
||||
{feed.length > 0 && (
|
||||
<>
|
||||
{rules && rules.length > 0 && <SubplebbitRules subplebbitAddress={subplebbitAddress} createdAt={createdAt} rules={rules} />}
|
||||
|
||||
@@ -22,7 +22,7 @@ const PostPage = () => {
|
||||
const isInDescriptionView = isDescriptionView(location.pathname, params);
|
||||
const isInRulesView = isRulesView(location.pathname, params);
|
||||
|
||||
const { showReplyModal, activeCid, openReplyModal, closeModal } = useReplyModal();
|
||||
const { activeCid, closeModal, openReplyModal, showReplyModal, scrollY } = useReplyModal();
|
||||
|
||||
const post = useComment({ commentCid });
|
||||
const { deleted, locked, removed } = post || {};
|
||||
@@ -34,7 +34,7 @@ const PostPage = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.content}>
|
||||
{showReplyModal && activeCid && <ReplyModal closeModal={closeModal} parentCid={activeCid} />}
|
||||
{showReplyModal && activeCid && <ReplyModal closeModal={closeModal} parentCid={activeCid} scrollY={scrollY} />}
|
||||
{isInDescriptionView ? (
|
||||
<SubplebbitDescription
|
||||
avatarUrl={suggested?.avatarUrl}
|
||||
|
||||
Reference in New Issue
Block a user