mirror of https://gitee.com/answerdev/answer.git
fix: timline show votes condition
This commit is contained in:
parent
68879eb4cf
commit
71f8a21032
|
@ -18,11 +18,11 @@ const Index: FC = () => {
|
|||
const [isLoading, setLoading] = useState(false);
|
||||
const [timelineData, setTimelineData] = useState<Type.TimelineRes>();
|
||||
|
||||
const getPageData = () => {
|
||||
const getPageData = (bol: boolean) => {
|
||||
setLoading(true);
|
||||
getTimelineData({
|
||||
object_id: tid || aid || qid,
|
||||
show_vote: showVotes,
|
||||
show_vote: bol,
|
||||
})
|
||||
.then((res) => {
|
||||
setTimelineData(res);
|
||||
|
@ -34,11 +34,11 @@ const Index: FC = () => {
|
|||
|
||||
const handleSwitch = (bol: boolean) => {
|
||||
setShowVotes(bol);
|
||||
getPageData();
|
||||
getPageData(bol);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getPageData();
|
||||
getPageData(false);
|
||||
}, []);
|
||||
|
||||
let linkUrl = '';
|
||||
|
|
Loading…
Reference in New Issue