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
- name: Lint with Biome
run: npx biome ci .
run: npm run check:code
- name: Lint styles
run: npm run lint:styles

View File

@ -2,7 +2,7 @@
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"files": {
"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": {
"defaultBranch": "dev",

View File

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

View File

@ -49,17 +49,15 @@ export const ImageSwiper = (props: Props) => {
)
onMount(async () => {
console.log("!!! onMount:");
const { register } = await import('swiper/element/bundle')
register()
SwiperCore.use([Pagination, Navigation, Manipulation])
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(() => {
const updateDirection = () => {
const width = window.innerWidth

View File

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