Skip to content

Commit

Permalink
added localLinkOpener to open exercise channel
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-wls committed Jan 13, 2025
1 parent 90ea7c3 commit aee368c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.ui.unit.dp
import com.google.accompanist.web.WebViewState
import de.tum.informatics.www1.artemis.native_app.core.model.exercise.Exercise
import de.tum.informatics.www1.artemis.native_app.core.model.exercise.QuizExercise
import de.tum.informatics.www1.artemis.native_app.core.ui.LocalLinkOpener
import de.tum.informatics.www1.artemis.native_app.core.ui.Spacings
import de.tum.informatics.www1.artemis.native_app.core.ui.compose.ArtemisWebView
import de.tum.informatics.www1.artemis.native_app.core.ui.date.getRelativeTime
Expand Down Expand Up @@ -283,6 +284,7 @@ private fun ExerciseInformation(

ExerciseChannelLink(
modifier = Modifier.fillMaxWidth(),
exercise = exercise,
exerciseChannel = exerciseChannel
)
}
Expand Down Expand Up @@ -338,8 +340,11 @@ private fun TextAndValueRow(
@Composable
private fun ExerciseChannelLink(
modifier: Modifier,
exercise: Exercise,
exerciseChannel: ChannelChat?
) {
val localLinkOpener = LocalLinkOpener.current

Row(
modifier = modifier.padding(start = 8.dp, top = 4.dp, bottom = 4.dp),
verticalAlignment = Alignment.CenterVertically,
Expand All @@ -355,7 +360,10 @@ private fun ExerciseChannelLink(

Row(
modifier = Modifier.clickable {

val courseId = exercise.course?.id
if (exerciseChannel != null && courseId != null) {
localLinkOpener.openLink("artemis://courses/$courseId/messages?conversationId=${exerciseChannel.id}")
}
},
verticalAlignment = Alignment.CenterVertically
) {
Expand Down

0 comments on commit aee368c

Please sign in to comment.