about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-10-01 11:17:46 +0900
committerGitHub <noreply@github.com>2020-10-01 04:17:46 +0200
commitbec8b12bb52a57b54b66899b2650a5611d9bd561 (patch)
treeb636c6fc17d50d1fb5faa8b42c8ff8cf5169520f /app/javascript/mastodon/actions
parent65136600e36ded708dc4ea5a1ef04031db51b021 (diff)
Fix mark as read in notifications to be saved immediately (#14907)
* Fix mark as read in notifications to be saved immediately

* fix code style
Diffstat (limited to 'app/javascript/mastodon/actions')
-rw-r--r--app/javascript/mastodon/actions/markers.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/javascript/mastodon/actions/markers.js b/app/javascript/mastodon/actions/markers.js
index 41a95503e..c4b61effd 100644
--- a/app/javascript/mastodon/actions/markers.js
+++ b/app/javascript/mastodon/actions/markers.js
@@ -100,8 +100,12 @@ export function submitMarkersSuccess({ home, notifications }) {
   };
 };
 
-export function submitMarkers() {
-  return (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState);
+export function submitMarkers(params = {}) {
+  const result = (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState);
+  if (params.immediate === true) {
+    debouncedSubmitMarkers.flush();
+  }
+  return result;
 };
 
 export const fetchMarkers = () => (dispatch, getState) => {