@@ -369,19 +369,24 @@ private void onAcceptFilter()
369
369
final boolean deletable ;
370
370
final boolean editable ;
371
371
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 )
374
373
{
375
374
deletable = this .deletingBadgeEnabled ;
376
375
editable = this .editingBadgeEnabled ;
377
376
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
+ }
385
390
}
386
391
else
387
392
{
@@ -461,17 +466,15 @@ private void onAcceptFilter()
461
466
// Make the cancel button invisible
462
467
this .btnCancelFilter .setVisible (false );
463
468
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
464
474
// Set the customization rating for the filter select and condition select
465
475
this .setUsedCustomizationDegreeForComponents (customizationDegree );
466
476
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 ();
475
478
476
479
// Remove filter, update grid
477
480
this .removeChipBadgeCondition (badge );
0 commit comments