@@ -259,7 +259,10 @@ export const handleSharedDashboardsThunk = () => (dispatch: any) => {
259
259
const skipConfirmation = urlParams . get ( 'skipConfirmation' ) == 'Yes' ;
260
260
261
261
const dashboardDatabase = urlParams . get ( 'dashboardDatabase' ) ;
262
- dispatch ( setStandaloneDashboardDatabase ( dashboardDatabase ) ) ;
262
+ if ( dashboardDatabase ) {
263
+ dispatch ( setStandaloneDashboardDatabase ( dashboardDatabase ) ) ;
264
+ }
265
+
263
266
if ( urlParams . get ( 'credentials' ) ) {
264
267
setWelcomeScreenOpen ( false ) ;
265
268
const connection = decodeURIComponent ( urlParams . get ( 'credentials' ) ) ;
@@ -363,6 +366,8 @@ export const onConfirmLoadSharedDashboardThunk = () => (dispatch: any, getState:
363
366
364
367
if ( shareDetails . dashboardDatabase ) {
365
368
dispatch ( setStandaloneDashboardDatabase ( shareDetails . dashboardDatabase ) ) ;
369
+ } else if ( ! state . application . standaloneDashboardDatabase ) {
370
+ // No standalone dashboard database configured, fall back to default
366
371
dispatch ( setStandaloneDashboardDatabase ( shareDetails . database ) ) ;
367
372
}
368
373
if ( shareDetails . url ) {
@@ -452,6 +457,9 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
452
457
dispatch ( setSSOProviders ( config . ssoProviders ) ) ;
453
458
454
459
const { standalone } = config ;
460
+ // if a dashboard database was previously set, remember to use it.
461
+ const dashboardDatabase = state . application . standaloneDashboardDatabase ;
462
+
455
463
dispatch (
456
464
setStandaloneEnabled (
457
465
standalone ,
@@ -460,7 +468,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
460
468
config . standalonePort ,
461
469
config . standaloneDatabase ,
462
470
config . standaloneDashboardName ,
463
- config . standaloneDashboardDatabase ,
471
+ dashboardDatabase || config . standaloneDashboardDatabase ,
464
472
config . standaloneDashboardURL ,
465
473
config . standaloneUsername ,
466
474
config . standalonePassword ,
0 commit comments