@@ -259,7 +259,10 @@ export const handleSharedDashboardsThunk = () => (dispatch: any) => {
259259 const skipConfirmation = urlParams . get ( 'skipConfirmation' ) == 'Yes' ;
260260
261261 const dashboardDatabase = urlParams . get ( 'dashboardDatabase' ) ;
262- dispatch ( setStandaloneDashboardDatabase ( dashboardDatabase ) ) ;
262+ if ( dashboardDatabase ) {
263+ dispatch ( setStandaloneDashboardDatabase ( dashboardDatabase ) ) ;
264+ }
265+
263266 if ( urlParams . get ( 'credentials' ) ) {
264267 setWelcomeScreenOpen ( false ) ;
265268 const connection = decodeURIComponent ( urlParams . get ( 'credentials' ) ) ;
@@ -363,6 +366,8 @@ export const onConfirmLoadSharedDashboardThunk = () => (dispatch: any, getState:
363366
364367 if ( shareDetails . dashboardDatabase ) {
365368 dispatch ( setStandaloneDashboardDatabase ( shareDetails . dashboardDatabase ) ) ;
369+ } else if ( ! state . application . standaloneDashboardDatabase ) {
370+ // No standalone dashboard database configured, fall back to default
366371 dispatch ( setStandaloneDashboardDatabase ( shareDetails . database ) ) ;
367372 }
368373 if ( shareDetails . url ) {
@@ -452,6 +457,9 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
452457 dispatch ( setSSOProviders ( config . ssoProviders ) ) ;
453458
454459 const { standalone } = config ;
460+ // if a dashboard database was previously set, remember to use it.
461+ const dashboardDatabase = state . application . standaloneDashboardDatabase ;
462+
455463 dispatch (
456464 setStandaloneEnabled (
457465 standalone ,
@@ -460,7 +468,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
460468 config . standalonePort ,
461469 config . standaloneDatabase ,
462470 config . standaloneDashboardName ,
463- config . standaloneDashboardDatabase ,
471+ dashboardDatabase || config . standaloneDashboardDatabase ,
464472 config . standaloneDashboardURL ,
465473 config . standaloneUsername ,
466474 config . standalonePassword ,
0 commit comments