Fix timeline markers not working on Chrome (#13887)
* Periodically save timeline markers This saves timeline markers immediately upon message arrival, but not more than once every 5 minutes. This does not change how the markers are saved on closing the window, except that it avoids submitting them if there is no need for it. * Use the Fetch API when possible instead of XHR on window unload
This commit is contained in:
parent
8bbc81c71e
commit
5aff2a6957
6 changed files with 115 additions and 24 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
importFetchedStatus,
|
||||
importFetchedStatuses,
|
||||
} from './importer';
|
||||
import { submitMarkers } from './markers';
|
||||
import { saveSettings } from './settings';
|
||||
import { defineMessages } from 'react-intl';
|
||||
import { List as ImmutableList } from 'immutable';
|
||||
|
@ -70,6 +71,8 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
|
|||
filtered = regex && regex.test(searchIndex);
|
||||
}
|
||||
|
||||
dispatch(submitMarkers());
|
||||
|
||||
if (showInColumn) {
|
||||
dispatch(importFetchedAccount(notification.account));
|
||||
|
||||
|
@ -157,6 +160,7 @@ export function expandNotifications({ maxId } = {}, done = noOp) {
|
|||
|
||||
dispatch(expandNotificationsSuccess(response.data, next ? next.uri : null, isLoadingMore, isLoadingRecent, isLoadingRecent && preferPendingItems));
|
||||
fetchRelatedRelationships(dispatch, response.data);
|
||||
dispatch(submitMarkers());
|
||||
}).catch(error => {
|
||||
dispatch(expandNotificationsFail(error, isLoadingMore));
|
||||
}).finally(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue