From 02c3c333cf32a5d929d7cc535669bda55bdc04fa Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Fri, 13 Feb 2026 09:02:31 +0100 Subject: [PATCH] fix(share): resolve typescript errors in ReaderView and ShareButton --- web/src/components/ReaderView.tsx | 3 +-- web/src/components/ShareButton.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/components/ReaderView.tsx b/web/src/components/ReaderView.tsx index 0e72bb7..1100264 100644 --- a/web/src/components/ReaderView.tsx +++ b/web/src/components/ReaderView.tsx @@ -1,6 +1,5 @@ -import { ReaderViewProps } from './ReaderView'; // Self-reference import seems wrong, removing. +import { useState } from 'react'; import { ShareButton } from './ShareButton'; -// No need to import ReaderViewProps if we define it here, but let's keep clean. import { type Article, articlesApi } from '../api/articles'; interface ReaderViewProps { diff --git a/web/src/components/ShareButton.tsx b/web/src/components/ShareButton.tsx index d779ec5..655ad97 100644 --- a/web/src/components/ShareButton.tsx +++ b/web/src/components/ShareButton.tsx @@ -35,7 +35,7 @@ export function ShareButton({ article, className = "" }: ShareButtonProps) { }; const copyToClipboard = () => { - navigator.clipboard.writeText(article.url); + navigator.clipboard.writeText(article.url || window.location.href); setCopied(true); setTimeout(() => setCopied(false), 2000); setIsOpen(false);