@@ -389,6 +389,10 @@ const annotationsSlice = createSlice({
389
389
state . username ,
390
390
) ;
391
391
392
+ delete state . annotations . constants [ action . payload . target ] ;
393
+ delete state . annotations . optionals [ action . payload . target ] ;
394
+ delete state . annotations . requireds [ action . payload . target ] ;
395
+
392
396
updateQueue ( state ) ;
393
397
} ,
394
398
removeAttribute ( state , action : PayloadAction < string > ) {
@@ -489,6 +493,10 @@ const annotationsSlice = createSlice({
489
493
state . username ,
490
494
) ;
491
495
496
+ delete state . annotations . attributes [ action . payload . target ] ;
497
+ delete state . annotations . optionals [ action . payload . target ] ;
498
+ delete state . annotations . requireds [ action . payload . target ] ;
499
+
492
500
updateQueue ( state ) ;
493
501
} ,
494
502
upsertConstants ( state , action : PayloadAction < ConstantAnnotation [ ] > ) {
@@ -498,6 +506,10 @@ const annotationsSlice = createSlice({
498
506
annotation ,
499
507
state . username ,
500
508
) ;
509
+
510
+ delete state . annotations . attributes [ annotation . target ] ;
511
+ delete state . annotations . optionals [ annotation . target ] ;
512
+ delete state . annotations . requireds [ annotation . target ] ;
501
513
} ) ;
502
514
503
515
updateQueue ( state ) ;
@@ -662,6 +674,10 @@ const annotationsSlice = createSlice({
662
674
state . username ,
663
675
) ;
664
676
677
+ delete state . annotations . attributes [ action . payload . target ] ;
678
+ delete state . annotations . constants [ action . payload . target ] ;
679
+ delete state . annotations . requireds [ action . payload . target ] ;
680
+
665
681
updateQueue ( state ) ;
666
682
} ,
667
683
upsertOptionals ( state , action : PayloadAction < OptionalAnnotation [ ] > ) {
@@ -671,6 +687,10 @@ const annotationsSlice = createSlice({
671
687
annotation ,
672
688
state . username ,
673
689
) ;
690
+
691
+ delete state . annotations . attributes [ annotation . target ] ;
692
+ delete state . annotations . constants [ annotation . target ] ;
693
+ delete state . annotations . requireds [ annotation . target ] ;
674
694
} ) ;
675
695
676
696
updateQueue ( state ) ;
@@ -750,15 +770,23 @@ const annotationsSlice = createSlice({
750
770
state . username ,
751
771
) ;
752
772
773
+ delete state . annotations . attributes [ action . payload . target ] ;
774
+ delete state . annotations . constants [ action . payload . target ] ;
775
+ delete state . annotations . optionals [ action . payload . target ] ;
776
+
753
777
updateQueue ( state ) ;
754
778
} ,
755
- upsertRequireds ( state , action : PayloadAction < RequiredAnnotation [ ] > ) {
779
+ addRequireds ( state , action : PayloadAction < RequiredAnnotation [ ] > ) {
756
780
action . payload . forEach ( ( annotation ) => {
757
781
state . annotations . requireds [ annotation . target ] = withAuthorAndReviewers (
758
782
state . annotations . requireds [ annotation . target ] ,
759
783
annotation ,
760
784
state . username ,
761
785
) ;
786
+
787
+ delete state . annotations . attributes [ annotation . target ] ;
788
+ delete state . annotations . constants [ annotation . target ] ;
789
+ delete state . annotations . optionals [ annotation . target ] ;
762
790
} ) ;
763
791
764
792
updateQueue ( state ) ;
@@ -931,7 +959,7 @@ export const {
931
959
removeRenaming,
932
960
reviewRenaming,
933
961
addRequired,
934
- upsertRequireds ,
962
+ addRequireds ,
935
963
removeRequired,
936
964
reviewRequired,
937
965
upsertTodo,
0 commit comments