search fix + some minor fixes
This commit is contained in:
parent
95bf7ba95a
commit
41cc07e30f
|
@ -65,7 +65,8 @@ export const LoginForm = () => {
|
||||||
setIsLinkSent(true)
|
setIsLinkSent(true)
|
||||||
setIsEmailNotConfirmed(false)
|
setIsEmailNotConfirmed(false)
|
||||||
setSubmitError('')
|
setSubmitError('')
|
||||||
changeSearchParams({ mode: 'forgot-password' }) // NOTE: temporary solition
|
changeSearchParams({ mode: 'forgot-password' })
|
||||||
|
// NOTE: temporary solition, needs logix in authorizer
|
||||||
/* FIXME:
|
/* FIXME:
|
||||||
const { actions: { authorizer } } = useSession()
|
const { actions: { authorizer } } = useSession()
|
||||||
const result = await authorizer().verifyEmail({ token })
|
const result = await authorizer().verifyEmail({ token })
|
||||||
|
|
|
@ -196,8 +196,7 @@ export const HeaderAuth = (props: Props) => {
|
||||||
>
|
>
|
||||||
<Show when={!isSaveButtonVisible()}>
|
<Show when={!isSaveButtonVisible()}>
|
||||||
<div class={clsx(styles.userControlItem, styles.userControlItemInbox)}>
|
<div class={clsx(styles.userControlItem, styles.userControlItemInbox)}>
|
||||||
<a href="/inbox">
|
<a href={getPagePath(router, 'inbox')}>
|
||||||
{/*FIXME: replace with route*/}
|
|
||||||
<div classList={{ entered: page().path === '/inbox' }}>
|
<div classList={{ entered: page().path === '/inbox' }}>
|
||||||
<Icon name="inbox-white" class={styles.icon} />
|
<Icon name="inbox-white" class={styles.icon} />
|
||||||
<Icon name="inbox-white-hover" class={clsx(styles.icon, styles.iconHover)} />
|
<Icon name="inbox-white-hover" class={clsx(styles.icon, styles.iconHover)} />
|
||||||
|
|
|
@ -115,15 +115,6 @@ export const AuthorView = (props: Props) => {
|
||||||
restoreScrollPosition()
|
restoreScrollPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use title
|
|
||||||
// const title = createMemo(() => {
|
|
||||||
// const m = searchParams().by
|
|
||||||
// if (m === 'viewed') return t('Top viewed')
|
|
||||||
// if (m === 'rating') return t('Top rated')
|
|
||||||
// if (m === 'commented') return t('Top discussed')
|
|
||||||
// return t('Top recent')
|
|
||||||
// })
|
|
||||||
|
|
||||||
const pages = createMemo<Shout[][]>(() =>
|
const pages = createMemo<Shout[][]>(() =>
|
||||||
splitToPages(sortedArticles(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE),
|
splitToPages(sortedArticles(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE),
|
||||||
)
|
)
|
||||||
|
|
|
@ -54,11 +54,6 @@ export const SearchView = (props: Props) => {
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const q = window.location.pathname.replace('/search/', '') || props.query
|
const q = window.location.pathname.replace('/search/', '') || props.query
|
||||||
setQuery(q)
|
setQuery(q)
|
||||||
if (sortedArticles() && !sortedArticles()[0].created_at) {
|
|
||||||
// TODO: fill up articles data structures in search results
|
|
||||||
console.info('[SearchView] poor articles data structure found')
|
|
||||||
await loadMore()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: use score from the search results to sort by relevance
|
// TODO: use score from the search results to sort by relevance
|
||||||
|
|
|
@ -56,7 +56,7 @@ export const InboxProvider = (props: { children: JSX.Element }) => {
|
||||||
): Promise<Array<Message>> => {
|
): Promise<Array<Message>> => {
|
||||||
if (inboxClient.private) {
|
if (inboxClient.private) {
|
||||||
const msgs = await inboxClient.loadChatMessages({ by, limit, offset })
|
const msgs = await inboxClient.loadChatMessages({ by, limit, offset })
|
||||||
setMessages((mmm) => [...mmm, ...msgs]) // TODO: check unique
|
setMessages((mmm) => [...new Set([...mmm, ...msgs])])
|
||||||
return msgs || []
|
return msgs || []
|
||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
|
|
|
@ -60,15 +60,7 @@ export const showModal = (modalType: ModalType, modalSource?: AuthModalSource) =
|
||||||
setModal(modalType)
|
setModal(modalType)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: find a better solution
|
export const hideModal = () => setModal(null)
|
||||||
export const hideModal = () => {
|
|
||||||
const newSearchParams: Partial<AuthModalSearchParams & ConfirmEmailSearchParams & RootSearchParams> = {
|
|
||||||
modal: null,
|
|
||||||
source: null,
|
|
||||||
}
|
|
||||||
|
|
||||||
setModal(null)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const useModalStore = () => {
|
export const useModalStore = () => {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user