Fix reading list rendering multiple times (#9364)

This commit is contained in:
Cain Watson 2020-07-17 06:53:43 -05:00 committed by GitHub
parent 73a3bcc68a
commit 6853e103ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,9 @@ import { ReadingList } from '../readingList/readingList';
function loadElement() {
getUserDataAndCsrfToken().then(({ currentUser }) => {
const followedTagNames = JSON.parse(currentUser.followed_tags).map(t => t.name);
const followedTagNames = JSON.parse(currentUser.followed_tags).map(
(t) => t.name,
);
const root = document.getElementById('reading-list');
if (root) {
render(
@ -13,7 +15,6 @@ function loadElement() {
statusView={root.dataset.view}
/>,
root,
root.firstElementChild,
);
}
});