parent
8b066104e6
commit
b1b3f8b435
|
@ -94,10 +94,6 @@ export const App = (props: Props) => {
|
|||
const is404 = createMemo(() => props.is404)
|
||||
|
||||
createEffect(() => {
|
||||
if (!searchParams().m) {
|
||||
hideModal()
|
||||
}
|
||||
|
||||
const modal = MODALS[searchParams().m]
|
||||
if (modal) {
|
||||
showModal(modal)
|
||||
|
|
|
@ -19,13 +19,6 @@ type Props = {
|
|||
|
||||
const PAGE_SIZE = 20
|
||||
|
||||
// TODO: проверить нет ли дубликатов в базе данных, если нет - то не использовать addUniqueAuthors()
|
||||
const addUniqueAuthors = (prevAuthors: Author[], newAuthors: Author[]) => {
|
||||
const uniqueNewAuthors = newAuthors.filter(
|
||||
(newAuthor) => !prevAuthors.some((prevAuthor) => prevAuthor.id === newAuthor.id),
|
||||
)
|
||||
return [...prevAuthors, ...uniqueNewAuthors]
|
||||
}
|
||||
export const AuthorsList = (props: Props) => {
|
||||
const { t } = useLocalize()
|
||||
const { isOwnerSubscribed } = useFollowing()
|
||||
|
@ -44,9 +37,9 @@ export const AuthorsList = (props: Props) => {
|
|||
})
|
||||
|
||||
if (queryType === 'shouts') {
|
||||
setAuthorsByShouts((prev) => addUniqueAuthors(prev, result))
|
||||
setAuthorsByShouts((prev) => [...prev, ...result])
|
||||
} else {
|
||||
setAuthorsByFollowers((prev) => addUniqueAuthors(prev, result))
|
||||
setAuthorsByFollowers((prev) => [...prev, ...result])
|
||||
}
|
||||
setLoading(false)
|
||||
}
|
||||
|
|
|
@ -53,7 +53,6 @@ export const RegisterForm = () => {
|
|||
|
||||
const handleSubmit = async (event: Event) => {
|
||||
event.preventDefault()
|
||||
|
||||
if (passwordError()) {
|
||||
setValidationErrors((errors) => ({ ...errors, password: passwordError() }))
|
||||
} else {
|
||||
|
@ -102,7 +101,7 @@ export const RegisterForm = () => {
|
|||
redirect_uri: window.location.origin,
|
||||
}
|
||||
const { errors } = await signUp(opts)
|
||||
if (errors) return
|
||||
if (errors.length > 0) return
|
||||
setIsSuccess(true)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
@ -134,7 +133,6 @@ export const RegisterForm = () => {
|
|||
),
|
||||
}))
|
||||
break
|
||||
|
||||
case 'verified':
|
||||
setValidationErrors((prev) => ({
|
||||
email: (
|
||||
|
|
|
@ -96,7 +96,6 @@ export const SendResetLinkForm = () => {
|
|||
placeholder={t('Email')}
|
||||
onInput={(event) => handleEmailInput(event.currentTarget.value)}
|
||||
/>
|
||||
|
||||
<label for="email">{t('Email')}</label>
|
||||
<Show when={isUserNotFound()}>
|
||||
<div class={styles.validationError}>
|
||||
|
|
|
@ -122,7 +122,13 @@ export const SessionProvider = (props: {
|
|||
m: 'auth',
|
||||
access_token,
|
||||
})
|
||||
else if (token) changeSearchParams({ mode: 'change-password', modal: 'auth', token })
|
||||
else if (token) {
|
||||
changeSearchParams({
|
||||
mode: 'change-password',
|
||||
m: 'auth',
|
||||
token,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// load
|
||||
|
@ -207,7 +213,6 @@ export const SessionProvider = (props: {
|
|||
if (session()) {
|
||||
const token = session()?.access_token
|
||||
if (token) {
|
||||
// console.log('[context.session] token observer got token', token)
|
||||
if (!inboxClient.private) {
|
||||
apiClient.connect(token)
|
||||
notifierClient.connect(token)
|
||||
|
@ -333,7 +338,6 @@ export const SessionProvider = (props: {
|
|||
const response = await authorizer().graphqlQuery({
|
||||
query: `query { is_registered(email: "${email}") { message }}`,
|
||||
})
|
||||
// console.log(response)
|
||||
return response?.data?.is_registered?.message
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
|
|
|
@ -25,6 +25,7 @@ export type PageProps = {
|
|||
export type RootSearchParams = {
|
||||
m: string // modal
|
||||
lang: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type LayoutType = 'article' | 'audio' | 'video' | 'image' | 'literature'
|
||||
|
|
Loading…
Reference in New Issue
Block a user