Skip to content

Commit

Permalink
Update clearRegions by slice()
Browse files Browse the repository at this point in the history
  • Loading branch information
panhe-xue authored Oct 16, 2024
1 parent fbb27e9 commit 198ce00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ class RegionsPlugin extends BasePlugin<RegionsPluginEvents, RegionsPluginOptions

/** Remove all regions */
public clearRegions() {
const regions: Region[] = JSON.parse(JSON.stringify(this.regions))
const regions = this.regions.slice()
regions.forEach((region) => region.remove())
this.regions = []
}
Expand Down

0 comments on commit 198ce00

Please sign in to comment.