fix: prevent bookmarking relays when not logged in
This commit is contained in:
parent
234c5228b0
commit
7e10fa80b8
1 changed files with 2 additions and 0 deletions
|
|
@ -108,6 +108,7 @@ export default function SaveRelayDropdownMenu({
|
|||
function RelayItem({ urls }: { urls: string[] }) {
|
||||
const { t } = useTranslation()
|
||||
const { isSmallScreen } = useScreenSize()
|
||||
const { checkLogin } = useNostr()
|
||||
const { favoriteRelays, addFavoriteRelays, deleteFavoriteRelays } = useFavoriteRelays()
|
||||
const saved = useMemo(
|
||||
() => urls.every((url) => favoriteRelays.includes(url)),
|
||||
|
|
@ -115,6 +116,7 @@ function RelayItem({ urls }: { urls: string[] }) {
|
|||
)
|
||||
|
||||
const handleClick = async () => {
|
||||
checkLogin()
|
||||
if (saved) {
|
||||
await deleteFavoriteRelays(urls)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue