fix(plugin-sequence): fix update pattern index (#1266)
This commit is contained in:
		
							parent
							
								
									627a8b264b
								
							
						
					
					
						commit
						a14a65596e
					
				| @ -261,8 +261,13 @@ export class SequenceField extends Field { | |||||||
|     const matched = this.match(instance.get(name)); |     const matched = this.match(instance.get(name)); | ||||||
|     if (matched) { |     if (matched) { | ||||||
|       await matched.slice(1) |       await matched.slice(1) | ||||||
|         .map((_, i) => sequencePatterns.get(patterns[i].type).update).filter(Boolean) |         .map((_, i) => sequencePatterns.get(patterns[i].type).update) | ||||||
|         .reduce((promise, update, i) => promise.then(() => update!.call(this, instance, matched[i + 1], patterns[i].options, options)), Promise.resolve()); |         .reduce((promise, update, i) => promise.then(() => { | ||||||
|  |           if (!update) { | ||||||
|  |             return; | ||||||
|  |           } | ||||||
|  |           update.call(this, instance, matched[i + 1], patterns[i].options, options) | ||||||
|  |         }), Promise.resolve()); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user