Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
AlertsScreen: Only fetch post info if content type is post
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
  • Loading branch information
theimpulson committed Mar 17, 2024
1 parent a0d3150 commit d34405a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavHostController
import io.aayush.relabs.R
import io.aayush.relabs.network.data.alert.ContentType
import io.aayush.relabs.network.data.alert.UserAlert
import io.aayush.relabs.network.data.post.PostInfo
import io.aayush.relabs.ui.components.AlertItem
Expand Down Expand Up @@ -104,7 +105,9 @@ fun AlertsScreen(
date = userAlert.created_at.long,
unread = userAlert.read_at == null,
onClicked = {
viewModel.getPostInfo(userAlert.content_id)
if (userAlert.content_type == ContentType.POST) {
viewModel.getPostInfo(userAlert.content_id)
}
}
)
}
Expand Down

0 comments on commit d34405a

Please sign in to comment.