projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '19865-search-clearing-fix'. Closes #19865.
[arvados-workbench2.git]
/
src
/
components
/
refresh-button
/
refresh-button.tsx
diff --git
a/src/components/refresh-button/refresh-button.tsx
b/src/components/refresh-button/refresh-button.tsx
index 9971547bf092a5462b90f4db0e9ee66bb32f43a7..e2fe54846820d3efbaf744ce20a1f75d57f0cfec 100644
(file)
--- a/
src/components/refresh-button/refresh-button.tsx
+++ b/
src/components/refresh-button/refresh-button.tsx
@@
-26,12
+26,17
@@
interface RefreshButtonProps {
onClick?: () => void;
}
onClick?: () => void;
}
+export const LAST_REFRESH_TIMESTAMP = 'lastRefreshTimestamp';
+
export const RefreshButton = ({ history, classes, onClick }: RouteComponentProps & WithStyles<CssRules> & RefreshButtonProps) =>
<Button
color="primary"
size="small"
variant="contained"
onClick={() => {
export const RefreshButton = ({ history, classes, onClick }: RouteComponentProps & WithStyles<CssRules> & RefreshButtonProps) =>
<Button
color="primary"
size="small"
variant="contained"
onClick={() => {
+ // Notify interested parties that the refresh button was clicked.
+ const now = (new Date()).getTime();
+ localStorage.setItem(LAST_REFRESH_TIMESTAMP, now.toString());
history.replace(window.location.pathname);
if (onClick) {
onClick();
history.replace(window.location.pathname);
if (onClick) {
onClick();