From 756b66b31fd02215fc2d8a30ae263a3bf08a90a6 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 12 Jul 2025 23:58:57 +0900 Subject: feat(backend,frontend): add feature to unsubscribe feed --- frontend/src/pages/Settings.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'frontend/src/pages/Settings.tsx') diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index 78fc306..81c90e0 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -5,7 +5,7 @@ import { GetFeedsDocument, MarkFeedReadDocument, MarkFeedUnreadDocument, - RemoveFeedDocument, + UnsubscribeFeedDocument, } from "../graphql/generated/graphql"; export function Settings() { @@ -14,7 +14,7 @@ export function Settings() { }); const [, markFeedRead] = useMutation(MarkFeedReadDocument); const [, markFeedUnread] = useMutation(MarkFeedUnreadDocument); - const [, removeFeed] = useMutation(RemoveFeedDocument); + const [, unsubscribeFeed] = useMutation(UnsubscribeFeedDocument); const [selectedFeeds, setSelectedFeeds] = useState>(new Set()); @@ -22,7 +22,7 @@ export function Settings() { refetchFeeds(); }; - const handleFeedDeleted = () => { + const handleFeedUnsubscribed = () => { refetchFeeds(); setSelectedFeeds(new Set()); }; @@ -62,17 +62,17 @@ export function Settings() { refetchFeeds(); }; - const handleBulkDelete = async () => { + const handleBulkUnsubscribe = async () => { const confirmed = window.confirm( - `Are you sure you want to delete ${selectedFeeds.size} selected feeds?`, + `Are you sure you want to unsubscribe from ${selectedFeeds.size} selected feeds?`, ); if (!confirmed) return; const promises = Array.from(selectedFeeds).map((feedId) => - removeFeed({ id: feedId }), + unsubscribeFeed({ id: feedId }), ); await Promise.all(promises); - handleFeedDeleted(); + handleFeedUnsubscribed(); }; const hasFeeds = feedsData?.feeds && feedsData.feeds.length > 0; @@ -82,10 +82,10 @@ export function Settings() {

Feed Settings

- {/* Add New Feed Section */} + {/* Subscribe to New Feed Section */}

- Add New Feed + Subscribe to New Feed

@@ -134,10 +134,10 @@ export function Settings() {
@@ -145,7 +145,7 @@ export function Settings() { )} -- cgit v1.2.3-70-g09d2