Skip to content

Commit

Permalink
feat: clearRegions‘
Browse files Browse the repository at this point in the history
  • Loading branch information
panhe committed Oct 15, 2024
1 parent d2939c2 commit fbb27e9
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: Region[] = JSON.parse(JSON.stringify(this.regions))
regions.forEach((region) => region.remove())
this.regions = []
}

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

0 comments on commit fbb27e9

Please sign in to comment.