Merge pull request #438 from Discours/hotfix/provile-dala-load

Load user profile
This commit is contained in:
Tony 2024-04-15 21:05:13 +03:00 committed by GitHub
commit bb7d289ff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 15 deletions

View File

@ -16,7 +16,7 @@ jobs:
run: npm run typecheck run: npm run typecheck
- name: Lint with Biome - name: Lint with Biome
run: npx biome ci . run: npm run check:code
- name: Lint styles - name: Lint styles
run: npm run lint:styles run: npm run lint:styles

View File

@ -2,7 +2,7 @@
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"files": { "files": {
"include": ["*.tsx", "*.ts", "*.js", "*.json"], "include": ["*.tsx", "*.ts", "*.js", "*.json"],
"ignore": ["./dist", "./node_modules", ".husky", "docs", "gen", "*.d.ts"] "ignore": ["./dist", "./node_modules", ".husky", "docs", "gen", "*.gen.ts", "*.d.ts"]
}, },
"vcs": { "vcs": {
"defaultBranch": "dev", "defaultBranch": "dev",

View File

@ -54,15 +54,16 @@ export const AuthorView = (props: Props) => {
const modal = MODALS[searchParams().m] const modal = MODALS[searchParams().m]
// current author // current author
createEffect(async () => {
await loadAuthor({ slug: props.authorSlug })
})
createEffect(() => { createEffect(() => {
if (props.authorSlug) { if (props.authorSlug && session()?.user?.app_data?.profile?.slug === props.authorSlug) {
if (session()?.user?.app_data?.profile?.slug === props.authorSlug) {
console.info('my own profile') console.info('my own profile')
const { profile, authors, topics } = session().user.app_data const { profile, authors, topics } = session().user.app_data
setFollowers(myFollowers) setFollowers(myFollowers)
setAuthor(profile) setAuthor(profile)
setFollowing([...authors, ...topics]) setFollowing([...authors, ...topics])
}
} else { } else {
try { try {
const a = authorEntities()[props.authorSlug] const a = authorEntities()[props.authorSlug]

View File

@ -49,17 +49,15 @@ export const ImageSwiper = (props: Props) => {
) )
onMount(async () => { onMount(async () => {
console.log("!!! onMount:");
const { register } = await import('swiper/element/bundle') const { register } = await import('swiper/element/bundle')
register() register()
SwiperCore.use([Pagination, Navigation, Manipulation]) SwiperCore.use([Pagination, Navigation, Manipulation])
while (!mainSwipeRef.current || !mainSwipeRef.current.swiper) { while (!mainSwipeRef.current || !mainSwipeRef.current.swiper) {
await new Promise(resolve => setTimeout(resolve, 10)); // wait 10 ms await new Promise((resolve) => setTimeout(resolve, 10)) // wait 10 ms
} }
mainSwipeRef.current.swiper.on('slideChange', handleSlideChange); mainSwipeRef.current.swiper.on('slideChange', handleSlideChange)
}) })
onMount(() => { onMount(() => {
const updateDirection = () => { const updateDirection = () => {
const width = window.innerWidth const width = window.innerWidth

View File

@ -1,5 +1,5 @@
import { createLazyMemo } from '@solid-primitives/memo' import { createLazyMemo } from '@solid-primitives/memo'
import { createSignal } from 'solid-js' import { createEffect, createSignal } from 'solid-js'
import { apiClient } from '../../graphql/client/core' import { apiClient } from '../../graphql/client/core'
import { Author, QueryLoad_Authors_ByArgs } from '../../graphql/schema/core.gen' import { Author, QueryLoad_Authors_ByArgs } from '../../graphql/schema/core.gen'