File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ import { withRouter } from 'lib/withRouter';
44
44
import { get } from 'lib/AJAX' ;
45
45
import BrowserFooter from './BrowserFooter.react' ;
46
46
47
+ const SELECTED_ROWS_MESSAGE =
48
+ 'There are selected rows. Are you sure you want to leave this page?' ;
49
+
47
50
function SelectedRowsNavigationPrompt ( { when } ) {
48
- const message =
49
- 'There are selected rows. Are you sure you want to leave this page?' ;
51
+ const message = SELECTED_ROWS_MESSAGE ;
50
52
51
53
React . useEffect ( ( ) => {
52
54
if ( ! when ) {
@@ -952,6 +954,11 @@ class Browser extends DashboardView {
952
954
}
953
955
954
956
async refresh ( ) {
957
+ if ( Object . keys ( this . state . selection ) . length > 0 ) {
958
+ if ( ! window . confirm ( SELECTED_ROWS_MESSAGE ) ) {
959
+ return ;
960
+ }
961
+ }
955
962
const relation = this . state . relation ;
956
963
const prevFilters = this . state . filters || new List ( ) ;
957
964
const initialState = {
You can’t perform that action at this time.
0 commit comments