Skip to content

Commit 52b907b

Browse files
committed
show a feedback msg when rss feed is successfully added
1 parent 1a71418 commit 52b907b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/features/settings/components/RssSetting.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ export const RssSetting = ({ setSelectedCards }: RssSettingProps) => {
1717
const { cards, setCards, userCustomCards, setUserCustomCards } = useUserPreferences()
1818

1919
const [rssUrl, setRssUrl] = useState<string | undefined>()
20-
const [rssInputError, setRssInputError] = useState<string | undefined>()
20+
const [RssInputFeedback, setRssInputFeedback] = useState<string | undefined>()
2121
const [isRssInputLoading, setIsRssInputLoading] = useState<boolean>(false)
2222

2323
const onRssAddClick = async () => {
2424
if (!rssUrl) {
25-
setRssInputError('Please provide an RSS Feed URL')
25+
setRssInputFeedback('Please provide an RSS Feed URL')
2626
return
2727
}
2828

2929
if (!isValidURL(rssUrl)) {
30-
setRssInputError('Invalid RSS Feed URL. Please check and try again')
30+
setRssInputFeedback('Invalid RSS Feed URL. Please check and try again')
3131
return
3232
}
3333

@@ -60,8 +60,9 @@ export const RssSetting = ({ setSelectedCards }: RssSettingProps) => {
6060
identifyUserCards(newCards.map((card) => card.name))
6161
trackRssSourceAdd(customCard.value)
6262
setRssUrl('')
63+
setRssInputFeedback('RSS Feed Added')
6364
} catch (_) {
64-
setRssInputError('Error occured. Please check and try again.')
65+
setRssInputFeedback('Error occured. Please check and try again')
6566
} finally {
6667
setIsRssInputLoading(false)
6768
}
@@ -93,9 +94,9 @@ export const RssSetting = ({ setSelectedCards }: RssSettingProps) => {
9394
</div>
9495
)}
9596
</div>
96-
{rssInputError && (
97+
{RssInputFeedback && (
9798
<div className="settingHint">
98-
<p>{rssInputError}</p>
99+
<p>{RssInputFeedback}</p>
99100
</div>
100101
)}
101102
</div>

0 commit comments

Comments
 (0)