Skip to content

Commit

Permalink
Fix(Regions): clearRegions (#3909)
Browse files Browse the repository at this point in the history
* feat: clearRegions‘

* Update clearRegions by slice()

---------

Co-authored-by: panhe <[email protected]>
  • Loading branch information
panhe-xue and panhe authored Oct 17, 2024
1 parent d2939c2 commit c185f47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,9 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions

/** Remove all regions */
public clearRegions() {
this.regions.forEach((region) => region.remove())
const regions = this.regions.slice()
regions.forEach((region) => region.remove())
this.regions = []
}

/** Destroy the plugin and clean up */
Expand Down

0 comments on commit c185f47

Please sign in to comment.