mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-14 20:11:22 +00:00
Merge remote-tracking branch 'upstream/develop' into feature/next-promotion-info
This commit is contained in:
commit
0fdacbd5bf
@ -397,7 +397,7 @@ function App() {
|
||||
addToBlockList,
|
||||
removeBlockFromList,
|
||||
getAllBlockedUsers,
|
||||
} = useBlockedAddresses();
|
||||
} = useBlockedAddresses(extState === 'authenticated');
|
||||
|
||||
const [currentNode, setCurrentNode] = useState({
|
||||
url: 'http://127.0.0.1:12391',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
|
||||
export const useBlockedAddresses = () => {
|
||||
export const useBlockedAddresses = (isAuthenticated?: boolean) => {
|
||||
const userBlockedRef = useRef({});
|
||||
const userNamesBlockedRef = useRef({});
|
||||
|
||||
@ -22,6 +22,9 @@ export const useBlockedAddresses = () => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated) return;
|
||||
userBlockedRef.current = {};
|
||||
userNamesBlockedRef.current = {};
|
||||
const fetchBlockedList = async () => {
|
||||
try {
|
||||
const response = await new Promise((res, rej) => {
|
||||
@ -82,7 +85,7 @@ export const useBlockedAddresses = () => {
|
||||
}
|
||||
};
|
||||
fetchBlockedList();
|
||||
}, []);
|
||||
}, [isAuthenticated]);
|
||||
|
||||
const removeBlockFromList = useCallback(async (address, name) => {
|
||||
if (name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user