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

[frontend bug]タイムラインに2回アクセスするとloading状態で止まってしまう #260

Closed
sota1235 opened this issue Aug 20, 2019 · 3 comments

Comments

@sota1235
Copy link
Collaborator

commented Aug 20, 2019

たぶんstate管理ミスってる

@sota1235 sota1235 added the frontend label Aug 20, 2019
@sota1235 sota1235 self-assigned this Aug 20, 2019
@sota1235

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 21, 2019

  • 同じページ間の移動でも@@router/LOCATION_CHANGEが発火する
  • が、現在は@@router/LOCATION_CHANGE発火時にpathがtimelineだったらisTimelineLoadingをtrueにしている
    • 再fetch, 再レンダリングを行うため

loadが発火すれば問題ないはずだが、同じページ間の移動のためItemListPage componentのconstructorが発火せずにisTimelineLoadingが更新されずにおかしなことになっている

@sota1235

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 21, 2019

解決案

  • 一番最初のLOCATION_CHANGE時にpathnameをstateに保存
  • 次回以降はcurrent pathと新しいpathを比較、同一の場合は何もしないように変更する
@sota1235

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 21, 2019

試してみたら他のリセットされてはいけないstateにも同じことしなきゃいけなくなった…くぅ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.