diff --git a/src/pages/bookmarks.jsx b/src/pages/bookmarks.jsx index a6ee0ad8..bdd4e660 100644 --- a/src/pages/bookmarks.jsx +++ b/src/pages/bookmarks.jsx @@ -4,7 +4,6 @@ import Icon from '../components/Icon'; import Link from '../components/link'; import Loader from '../components/Loader'; import Status from '../components/status'; -import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; const LIMIT = 40; @@ -15,21 +14,14 @@ function Bookmarks() { const [uiState, setUIState] = useState('default'); const [showMore, setShowMore] = useState(false); - const bookmarksIterator = useRef(masto.v1.bookmarks.list({ limit: LIMIT })); + const bookmarksIterator = useRef(); async function fetchBookmarks(firstLoad) { - console.log('fetchBookmarks', firstLoad); - if (firstLoad) { + if (firstLoad || !bookmarksIterator.current) { bookmarksIterator.current = masto.v1.bookmarks.list({ limit: LIMIT }); } const allBookmarks = await bookmarksIterator.current.next(); - if (allBookmarks.value?.length) { - const bookmarksValue = allBookmarks.value.map((status) => { - saveStatus(status, { - skipThreading: true, - override: false, - }); - return status; - }); + const bookmarksValue = allBookmarks.value; + if (bookmarksValue?.length) { if (firstLoad) { setBookmarks(bookmarksValue); } else { @@ -43,9 +35,7 @@ function Bookmarks() { setUIState('loading'); (async () => { try { - console.log('loadBookmarks', firstLoad); const { done } = await fetchBookmarks(firstLoad); - console.log('loadBookmarks', firstLoad); setShowMore(!done); setUIState('default'); } catch (e) { @@ -78,6 +68,9 @@ function Bookmarks() { }); } }} + onDblClick={(e) => { + loadBookmarks(true); + }} >