Loading client/src/store/historyStore/model/watchHistory.js +15 −5 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * submitted, delayed only by the throttle period and the request response time. */ import store from "store/index"; import defaultStore from "store/index"; import { urlData } from "utils/url"; import { getCurrentHistoryFromServer } from "./queries"; import { getGalaxyInstance } from "app"; Loading @@ -21,7 +21,7 @@ let lastUpdateTime = null; // last time changed history items have been requested let lastRequestDate = new Date(); export async function watchHistory() { export async function watchHistoryOnce(store) { // "Reset" watchTimeout so we don't queue up watchHistory calls in rewatchHistory. watchTimeout = null; // get current history Loading Loading @@ -64,10 +64,20 @@ export async function watchHistory() { }); } } } export async function watchHistory(store = defaultStore) { try { await watchHistoryOnce(store); } catch (error) { // would be fantastic if we could show some error alerting the user to this console.warn(error); } finally { watchTimeout = setTimeout(() => { watchHistory(); watchHistory(store); }, throttlePeriod); } } export function rewatchHistory() { if (watchTimeout) { Loading Loading
client/src/store/historyStore/model/watchHistory.js +15 −5 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * submitted, delayed only by the throttle period and the request response time. */ import store from "store/index"; import defaultStore from "store/index"; import { urlData } from "utils/url"; import { getCurrentHistoryFromServer } from "./queries"; import { getGalaxyInstance } from "app"; Loading @@ -21,7 +21,7 @@ let lastUpdateTime = null; // last time changed history items have been requested let lastRequestDate = new Date(); export async function watchHistory() { export async function watchHistoryOnce(store) { // "Reset" watchTimeout so we don't queue up watchHistory calls in rewatchHistory. watchTimeout = null; // get current history Loading Loading @@ -64,10 +64,20 @@ export async function watchHistory() { }); } } } export async function watchHistory(store = defaultStore) { try { await watchHistoryOnce(store); } catch (error) { // would be fantastic if we could show some error alerting the user to this console.warn(error); } finally { watchTimeout = setTimeout(() => { watchHistory(); watchHistory(store); }, throttlePeriod); } } export function rewatchHistory() { if (watchTimeout) { Loading