Skip to content

Commit

Permalink
fix: ringtone picker not stopping playback when closed
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed Apr 24, 2024
1 parent 35102c8 commit 626b47e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand Down Expand Up @@ -50,6 +51,11 @@ fun RingtonePickerDialog(
onDismissRequest.invoke()
}

DisposableEffect(Unit) {
onDispose {
ringingToneModel.stopRinging()
}
}
AlertDialog(
onDismissRequest = {
ringingToneModel.stopRinging()
Expand Down

0 comments on commit 626b47e

Please sign in to comment.