search fix + some minor fixes
Some checks failed
deploy / test (push) Failing after 55s
deploy / deploy (push) Has been skipped

This commit is contained in:
Untone 2023-12-25 08:31:26 +03:00
parent 95bf7ba95a
commit 41cc07e30f
6 changed files with 5 additions and 27 deletions

View File

@ -65,7 +65,8 @@ export const LoginForm = () => {
setIsLinkSent(true)
setIsEmailNotConfirmed(false)
setSubmitError('')
changeSearchParams({ mode: 'forgot-password' }) // NOTE: temporary solition
changeSearchParams({ mode: 'forgot-password' })
// NOTE: temporary solition, needs logix in authorizer
/* FIXME:
const { actions: { authorizer } } = useSession()
const result = await authorizer().verifyEmail({ token })

View File

@ -196,8 +196,7 @@ export const HeaderAuth = (props: Props) => {
>
<Show when={!isSaveButtonVisible()}>
<div class={clsx(styles.userControlItem, styles.userControlItemInbox)}>
<a href="/inbox">
{/*FIXME: replace with route*/}
<a href={getPagePath(router, 'inbox')}>
<div classList={{ entered: page().path === '/inbox' }}>
<Icon name="inbox-white" class={styles.icon} />
<Icon name="inbox-white-hover" class={clsx(styles.icon, styles.iconHover)} />

View File

@ -115,15 +115,6 @@ export const AuthorView = (props: Props) => {
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[][]>(() =>
splitToPages(sortedArticles(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE),
)

View File

@ -54,11 +54,6 @@ export const SearchView = (props: Props) => {
onMount(async () => {
const q = window.location.pathname.replace('/search/', '') || props.query
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

View File

@ -56,7 +56,7 @@ export const InboxProvider = (props: { children: JSX.Element }) => {
): Promise<Array<Message>> => {
if (inboxClient.private) {
const msgs = await inboxClient.loadChatMessages({ by, limit, offset })
setMessages((mmm) => [...mmm, ...msgs]) // TODO: check unique
setMessages((mmm) => [...new Set([...mmm, ...msgs])])
return msgs || []
}
return []

View File

@ -60,15 +60,7 @@ export const showModal = (modalType: ModalType, modalSource?: AuthModalSource) =
setModal(modalType)
}
// TODO: find a better solution
export const hideModal = () => {
const newSearchParams: Partial<AuthModalSearchParams & ConfirmEmailSearchParams & RootSearchParams> = {
modal: null,
source: null,
}
setModal(null)
}
export const hideModal = () => setModal(null)
export const useModalStore = () => {
return {