@@ -650,15 +650,7 @@ public BlockActionResult Save( ValidPropertiesBox<CheckInConfigurationSettingsBa
650650 entity . SaveAttributeValues ( RockContext ) ;
651651 } ) ;
652652
653- // Invalidate the kiosk device cache and push a refresh notification to all connected kiosks so
654- // configuration changes propagate without waiting for an app recycle. Mirrors the legacy
655- // WebForms block; the reflection call into Rock.CheckIn.v2.CheckInDirector matches the legacy
656- // approach (the API is intentionally still internal).
657- Rock . CheckIn . KioskDevice . Clear ( ) ;
658-
659- typeof ( GroupType ) . Assembly . GetType ( "Rock.CheckIn.v2.CheckInDirector" )
660- ? . GetMethod ( "SendRefreshKioskConfiguration" )
661- ? . Invoke ( null , new object [ 0 ] ) ;
653+ RefreshConnectedKiosks ( ) ;
662654
663655 if ( isNew )
664656 {
@@ -710,9 +702,7 @@ public BlockActionResult Delete( string key )
710702 entityService . Delete ( entity ) ;
711703 RockContext . SaveChanges ( ) ;
712704
713- // Invalidate the kiosk device cache so the deleted configuration is no longer served to any
714- // connected kiosks. Mirrors the legacy WebForms block.
715- Rock . CheckIn . KioskDevice . Clear ( ) ;
705+ RefreshConnectedKiosks ( ) ;
716706
717707 var pageRef = new Rock . Web . PageReference ( PageCache . Id ) ;
718708 var routeId = PageCache . PageRoutes . FirstOrDefault ( ) ? . Id ;
@@ -1326,6 +1316,24 @@ private bool ValidateGroupType( GroupType groupType, out string errorMessage )
13261316 return true ;
13271317 }
13281318
1319+ /// <summary>
1320+ /// Clears the kiosk device cache and pushes a refresh notification to all connected kiosks so configuration
1321+ /// changes propagate without waiting for an app recycle.
1322+ /// </summary>
1323+ private void RefreshConnectedKiosks ( )
1324+ {
1325+ #if NET472_OR_GREATER
1326+ // Temporary until legacy check-in is removed.
1327+ KioskDevice . Clear ( ) ;
1328+ #endif
1329+
1330+ // I know, this is a terrible hack. But we need to force the
1331+ // kiosks to refresh and we don't want to make this public yet. -dsh
1332+ typeof ( GroupType ) . Assembly . GetType ( "Rock.CheckIn.v2.CheckInDirector" )
1333+ ? . GetMethod ( "SendRefreshKioskConfiguration" )
1334+ ? . Invoke ( null , new object [ 0 ] ) ;
1335+ }
1336+
13291337 #endregion Private Methods
13301338 }
13311339}
0 commit comments