File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,10 +185,6 @@ function validateUpdates(
185185 return results ;
186186}
187187
188- // TODO: For ease of porting, I made each update a separate transaction. But it
189- // would be more efficient to batch them all into one transaction. That said,
190- // aside from bulk-tagging, it's most likely that only one update will be sent
191- // at a time.
192188async function statelyUpdate (
193189 updates : ProfileUpdate [ ] ,
194190 bungieMembershipId : number ,
Original file line number Diff line number Diff line change @@ -105,15 +105,6 @@ export async function updateItemAnnotation(
105105 destinyVersion,
106106 } ) ;
107107
108- if (
109- ( tagValue === 'clear' && ! ia . notes ) ||
110- ( notesValue === 'clear' && ! ia . tag ) ||
111- ( tagValue === 'clear' && notesValue === 'clear' )
112- ) {
113- itemsToDelete . push ( keyFor ( platformMembershipId , destinyVersion , itemAnnotation . id ) ) ;
114- continue ;
115- }
116-
117108 if ( tagValue === 'clear' ) {
118109 ia . tag = StatelyTagValue . TagValue_UNSPECIFIED ;
119110 } else if ( tagValue !== null ) {
@@ -130,7 +121,12 @@ export async function updateItemAnnotation(
130121 ia . craftedDate = BigInt ( itemAnnotation . craftedDate * 1000 ) ;
131122 }
132123
133- itemsToPut . push ( ia ) ;
124+ // If we're updating them both to nothing, delete the annotation
125+ if ( ! ia . notes && ! ia . tag ) {
126+ itemsToDelete . push ( keyFor ( platformMembershipId , destinyVersion , itemAnnotation . id ) ) ;
127+ } else {
128+ itemsToPut . push ( ia ) ;
129+ }
134130 }
135131
136132 if ( itemsToDelete . length ) {
You can’t perform that action at this time.
0 commit comments