@@ -369,19 +369,24 @@ private void onAcceptFilter()
369369 final boolean deletable ;
370370 final boolean editable ;
371371
372- // Check if it's an initial condition
373- if (this .editingBadgeId != null && !this .editingBadgeId .equals (NO_BADGE_ID_STRING ))
372+ if (this .deletingBadgeEnabled != null && this .editingBadgeEnabled != null )
374373 {
375374 deletable = this .deletingBadgeEnabled ;
376375 editable = this .editingBadgeEnabled ;
377376
378- // Get customization rating from initial condition
379- customizationDegree = this .initialChipBadges
380- .stream ()
381- .filter (e -> e .getBadgeId ().equals (this .editingBadgeId ))
382- .toList ()
383- .get (0 )
384- .getCustomizationRating ();
377+ this .deletingBadgeEnabled = null ;
378+ this .editingBadgeEnabled = null ;
379+
380+ if (this .editingBadgeId != null )
381+ {
382+ // Get customization rating from initial condition
383+ customizationDegree = this .initialChipBadges
384+ .stream ()
385+ .filter (e -> e .getBadgeId ().equals (this .editingBadgeId ))
386+ .toList ()
387+ .get (0 )
388+ .getCustomizationRating ();
389+ }
385390 }
386391 else
387392 {
@@ -461,17 +466,15 @@ private void onAcceptFilter()
461466 // Make the cancel button invisible
462467 this .btnCancelFilter .setVisible (false );
463468
469+ // Needed to save state of the condition if it was editable/deletable before editing
470+ this .editingBadgeEnabled = badge .isBtnEditEnabled ();
471+ this .deletingBadgeEnabled = badge .isBtnDeleteEnabled ();
472+
473+ // Just activated when the url parameters are enabled
464474 // Set the customization rating for the filter select and condition select
465475 this .setUsedCustomizationDegreeForComponents (customizationDegree );
466476
467- // Just activated when the url parameters are activated
468- if (!this .identifier .isBlank ())
469- {
470- this .editingBadgeId = badge .getBadgeId ();
471- // Needed for the acceptFilterBtn
472- this .editingBadgeEnabled = badge .isBtnEditEnabled ();
473- this .deletingBadgeEnabled = badge .isBtnDeleteEnabled ();
474- }
477+ this .editingBadgeId = badge .getBadgeId ();
475478
476479 // Remove filter, update grid
477480 this .removeChipBadgeCondition (badge );
0 commit comments