|
@ -14,22 +14,18 @@ const TopicListRow = (props) => { |
|
|
const dispatch = useDispatch(); |
|
|
const dispatch = useDispatch(); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (userAddress === topicData.userAddress) { |
|
|
if (userAddress !== topicData.userAddress) { |
|
|
const topicsDb = Object.values(orbit.stores).find((store) => store.dbname === 'topics'); |
|
|
|
|
|
|
|
|
|
|
|
setTopicSubject(topicsDb.get(topicId)); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dispatch({ |
|
|
dispatch({ |
|
|
type: FETCH_USER_DATABASE, |
|
|
type: FETCH_USER_DATABASE, |
|
|
orbit, |
|
|
orbit, |
|
|
userAddress: topicData.userAddress, |
|
|
userAddress: topicData.userAddress, |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
}, [dispatch, orbit, topicData.userAddress, topicId, userAddress]); |
|
|
}, [dispatch, orbit, topicData.userAddress, topicId, userAddress]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
const topicFound = topics.find((topic) => topic.id === topicId); |
|
|
const topicFound = topics |
|
|
|
|
|
.find((topic) => topic.id === topicId); |
|
|
|
|
|
|
|
|
if (topicFound) { |
|
|
if (topicFound) { |
|
|
setTopicSubject(topicFound); |
|
|
setTopicSubject(topicFound); |
|
|