Skip to content

Commit

Permalink
fix(api call): change order functions call
Browse files Browse the repository at this point in the history
in settings, update alarm value before making api call
  • Loading branch information
TheRealPad committed May 28, 2024
1 parent d3d0f8e commit 7f47d2b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ fun VibrationButton(context: Context, alarms: MutableState<Alarm>, mVibrator: Vi
),
checked = isVibrationActivate,
onCheckedChange = {
saveOnServer(apiUrl, accessToken, alarms.value)
alarms.value.vibration.isActivate = it; isVibrationActivate = it
saveOnServer(apiUrl, accessToken, alarms.value)
}
)
}
Expand Down Expand Up @@ -291,8 +291,8 @@ fun SoundButton(alarms: MutableState<Alarm>, context: Context, apiUrl: String, a
),
checked = isSoundActivate,
onCheckedChange = {
saveOnServer(apiUrl, accessToken, alarms.value)
alarms.value.sound.isActivate = it; isSoundActivate = it
saveOnServer(apiUrl, accessToken, alarms.value)
}
)
}
Expand Down

0 comments on commit 7f47d2b

Please sign in to comment.