From 8ea55b3632a71fd06ae22dede9cf2abfbf45837a Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 7 May 2024 01:15:57 +0300 Subject: [PATCH] header-hotfix --- src/components/Nav/Header/Header.tsx | 2 +- src/components/Nav/HeaderAuth.tsx | 6 +----- src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx | 8 +++++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/Nav/Header/Header.tsx b/src/components/Nav/Header/Header.tsx index c5d3da0e..f1342f1d 100644 --- a/src/components/Nav/Header/Header.tsx +++ b/src/components/Nav/Header/Header.tsx @@ -335,7 +335,7 @@ export const Header = (props: Props) => {
{ const { page } = useRouter() const { session, author, isSessionLoaded } = useSession() const { unreadNotificationsCount, showNotificationsPanel } = useNotifications() - const { form, toggleEditorPanel, saveShout, publishShout } = useEditorContext() + const { form, toggleEditorPanel, publishShout } = useEditorContext() const handleBellIconClick = (event: Event) => { event.preventDefault() @@ -59,10 +59,6 @@ export const HeaderAuth = (props: Props) => { toggleEditorPanel() } - const handleSaveButtonClick = () => { - saveShout(form) - } - const [width, setWidth] = createSignal(0) const [editorMode, setEditorMode] = createSignal(t('Editing')) diff --git a/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx b/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx index 35105dca..46a590b7 100644 --- a/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx +++ b/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx @@ -21,9 +21,11 @@ export const ArticleCardSwiper = (props: Props) => { const mainSwipeRef: { current: SwiperRef } = { current: null } onMount(async () => { - const { register } = await import('swiper/element/bundle') - register() - SwiperCore.use([Pagination, Navigation, Manipulation]) + if (props.slides.length > 1) { + const { register } = await import('swiper/element/bundle') + register() + SwiperCore.use([Pagination, Navigation, Manipulation]) + } }) return (