diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index ad9f5f66..4041aa2a 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -26,6 +26,7 @@ import { Loading } from '../../_shared/Loading' import { byCreated } from '../../../utils/sortby' import stylesArticle from '../../Article/Article.module.scss' import styles from './Author.module.scss' +import { hideModal, MODALS } from "../../../stores/ui"; type Props = { shouts: Shout[] @@ -40,13 +41,14 @@ export const AuthorView = (props: Props) => { const { loadSubscriptions } = useFollowing() const { sortedArticles } = useArticlesStore({ shouts: props.shouts }) const { authorEntities } = useAuthorsStore({ authors: [props.author] }) - const { page: getPage } = useRouter() + const { page: getPage, searchParams } = useRouter() const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false) const [isBioExpanded, setIsBioExpanded] = createSignal(false) const [followers, setFollowers] = createSignal([]) const [following, setFollowing] = createSignal>([]) const [showExpandBioControl, setShowExpandBioControl] = createSignal(false) const [commented, setCommented] = createSignal() + const modal = MODALS[searchParams().m] // current author const [author, setAuthor] = createSignal() @@ -92,7 +94,13 @@ export const AuthorView = (props: Props) => { } } - onMount(() => fetchData(props.authorSlug)) + onMount(() => { + fetchData(props.authorSlug) + + if (!modal) { + hideModal() + } + }); const loadMore = async () => { saveScrollPosition()