Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multi times route change listen #162

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Conversation

KurumiFrost
Copy link
Contributor

@KurumiFrost KurumiFrost commented Aug 17, 2022

Types of changes

  • New feature
  • Bug fix
  • Documentation change
  • Coding style change
  • Refactoring
  • Performance improvement
  • Test cases
  • Continuous integration
  • Typescript definition change
  • Breaking change

Background and context

toggle display tabs will cause multi times route listen
bug2
after this, close all tags and then into the hasn't cleared page will show multi tags on the tag bar
bug

Solution

I think the reason cause the problem is that not cleared route listener store the old data, so when the route changes they still use the old data to filter
after reassigned tagList, the listener somehow still use the old value

resetTabList() {
  this.tagList = [DEFAULT_ROUTE];
  this.cacheTabList.clear();
  this.cacheTabList.add(DEFAULT_ROUTE_NAME);
}

the main reason cause that is there exist over one route listeners. so I clear it after component destroyed

How is the change tested?

bug-fixed

Changelog

Changelog(CN) Changelog(EN) Related issues

Checklist:

  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others should be submitted to master branch)

Other information

@KurumiFrost KurumiFrost marked this pull request as ready for review August 17, 2022 11:31
@sHow8e sHow8e merged commit fc6f0b9 into arco-design:main Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants