-
Notifications
You must be signed in to change notification settings - Fork 3
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: アプリケーション登録画面で、登録処理中にボタンを押せないように #935
Conversation
Preview (prod backend + PR dashboard) → https://935.ns-preview.trapti.tech/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正感謝です🙏
修正方針これでいいと思います👍
try/finallyのやつだけ確認お願いします 🙏
dashboard/src/pages/apps/new.tsx
Outdated
setIsSubmitting(true) | ||
await props.submit() | ||
setIsSubmitting(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これってprops.submit()
がerrorをthrowしたときってsetIsSubmitting(false)
実行されましたっけ...?(されない気がする)
await props.submit()
をtry
で囲んで、setIsSubmitting(false)
をfinally
で囲んだ方が良いかもです :tanonda:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そう思ったんですが、ここのsubmit関数が既にtry-catchされてたのでthrowすることが確実にないなと思ってそのまま書いちゃいました
他の場所で使われる (throwする可能性のあるsubmitが渡される) ことを考慮して書いておいたほうが良いですかね?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あ~submit関数の中までちゃんと見れてませんでした、だとしたら書いても書かなくてもいいかもですね...(好みの問題かも)
僕だったら
他の場所で使われる (throwする可能性のあるsubmitが渡される) ことを考慮して書いておいたほうが良いですかね?
の気持ちでfinally書いちゃうと思いますがcp-20さんに任せます
どちらにせよこのままでもちゃんとうごくのでapproveしちゃいます
@@ -589,7 +593,6 @@ export default () => { | |||
setCurrentStep(formStep.repository) | |||
// 選択していたリポジトリをリセットする | |||
setParam({ repositoryID: undefined }) | |||
mutateRepo(undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かにこの部分いらなかったですね、削除感謝です 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(何もしてない気がするので、Linterが消した気がする……w)
なぜやるか
close #911
やったこと
アプリケーション登録画面で、登録処理中にボタンを押せないように
やらなかったこと
特になし
コメント
他のところと違う実装方法なんですが、分からなかったのでとりあえずこういう形で実装してみました
もっと良い実装方法があれば教えて欲しいです