Skip to content

Commit

Permalink
[feat/webview_bridge]: 중복 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
dogdduddy committed Sep 10, 2023
1 parent ef29cb3 commit 80086b4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ class WebAppInterface(
// 데이터 구조는 다시 상의 후에 결정해서, 객체화 시키면 좋을 것으로 보임
@JavascriptInterface
fun navigate(data: String) {
when(JSONObject(data).getString("route")) {
val result = JSONObject(data)

when(result.getString("route")) {
Route.EDIT_RESTAURANT.route-> {
val restaurantId = JSONObject(data).getString("restaurantId").toInt()
val restaurantId = result.getString("restaurantId").toInt()
navigateToRestaurantEdit(restaurantId)
}
}
Expand Down

0 comments on commit 80086b4

Please sign in to comment.