weird share answer duplicate fix

This commit is contained in:
“spicecat” 2022-08-18 17:58:26 -04:00
commit 3bb7711158
2 changed files with 4 additions and 4 deletions

View file

@ -35,7 +35,6 @@ export default function PaginatedListController({
if (hasAnswerAnchor) { if (hasAnswerAnchor) {
const anchorAnswer = document.getElementById('answersList'); const anchorAnswer = document.getElementById('answersList');
anchorAnswer.scrollIntoView({ behavior: 'smooth' }); anchorAnswer.scrollIntoView({ behavior: 'smooth' });
console.log(123, scroll, anchorAnswer)
} }
}, 2000) }, 2000)
} }

View file

@ -35,7 +35,7 @@ export function AnswersList() {
.catch(() => []); .catch(() => []);
const currentLocation = window.location.href; const currentLocation = window.location.href;
const hasAnswerAnchor = currentLocation.includes('#'); const hasAnswerAnchor = currentLocation.includes('#');
// console.log(answersList, 1111)
if (hasAnswerAnchor) { if (hasAnswerAnchor) {
const anchorAnswerId = `${currentLocation.substring(currentLocation.indexOf("#") + 1)}`; const anchorAnswerId = `${currentLocation.substring(currentLocation.indexOf("#") + 1)}`;
answersList.forEach(function (answer, i) { answersList.forEach(function (answer, i) {
@ -45,8 +45,9 @@ export function AnswersList() {
} }
}); });
} }
// console.log(answersList, 222) if (answersList.length > 2 && answersList[0].answer_id === answersList[1].answer_id)
answersList.splice(0, 1);
return answersList; return answersList;
} }