Replace deprecated methods

This commit is contained in:
Lim Chee Aun 2022-12-18 11:52:53 +08:00
parent 1ffcffa1f4
commit 16ae8af889
2 changed files with 4 additions and 4 deletions

View file

@ -16,13 +16,13 @@ function Home({ hidden }) {
const [uiState, setUIState] = useState('default'); const [uiState, setUIState] = useState('default');
const [showMore, setShowMore] = useState(false); const [showMore, setShowMore] = useState(false);
const statusIterator = useRef( const homeIterator = useRef(
masto.timelines.getHomeIterable({ masto.timelines.iterateHome({
limit: LIMIT, limit: LIMIT,
}), }),
).current; ).current;
async function fetchStatuses(firstLoad) { async function fetchStatuses(firstLoad) {
const allStatuses = await statusIterator.next( const allStatuses = await homeIterator.next(
firstLoad firstLoad
? { ? {
limit: LIMIT, limit: LIMIT,

View file

@ -207,7 +207,7 @@ function Notifications() {
const [onlyMentions, setOnlyMentions] = useState(false); const [onlyMentions, setOnlyMentions] = useState(false);
const notificationsIterator = useRef( const notificationsIterator = useRef(
masto.notifications.getIterator({ masto.notifications.iterate({
limit: LIMIT, limit: LIMIT,
}), }),
).current; ).current;