forked from MapComplete/MapComplete
		
	Fix soft deletion if the softdeletionTags are undefined
This commit is contained in:
		
							parent
							
								
									de89c3d12b
								
							
						
					
					
						commit
						399d671a23
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -6,6 +6,7 @@ import ChangeTagAction from "./ChangeTagAction" | |||
| import {TagsFilter} from "../../Tags/TagsFilter" | ||||
| import {And} from "../../Tags/And" | ||||
| import {Tag} from "../../Tags/Tag" | ||||
| import {Utils} from "../../../Utils"; | ||||
| 
 | ||||
| export default class DeleteAction extends OsmChangeAction { | ||||
|     private readonly _softDeletionTags: TagsFilter | ||||
|  | @ -30,16 +31,16 @@ export default class DeleteAction extends OsmChangeAction { | |||
|         this._id = id | ||||
|         this._hardDelete = hardDelete | ||||
|         this.meta = {...meta, changeType: "deletion"} | ||||
|         if (softDeletionTags.usedKeys().indexOf("fixme") >= 0) { | ||||
|         if (softDeletionTags?.usedKeys()?.indexOf("fixme") >= 0) { | ||||
|             this._softDeletionTags = softDeletionTags | ||||
|         } else { | ||||
|             this._softDeletionTags = new And([ | ||||
|             this._softDeletionTags = new And(Utils.NoNull([ | ||||
|                 softDeletionTags, | ||||
|                 new Tag( | ||||
|                     "fixme", | ||||
|                     `A mapcomplete user marked this feature to be deleted (${meta.specialMotivation})` | ||||
|                 ), | ||||
|             ]) | ||||
|             ])) | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue