Skip to content

Commit d141943

Browse files
fix: changes according detekt warnings
1 parent bba8a59 commit d141943

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

core/src/main/java/org/openedx/core/data/model/ShiftDueDatesBody.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import com.google.gson.annotations.SerializedName
44

55
data class ShiftDueDatesBody(
66
@SerializedName("course_keys") val courseKeys: List<String>
7-
)
7+
)

core/src/main/java/org/openedx/core/presentation/dates/DatesUI.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ import org.openedx.core.ui.theme.appTypography
3636
import org.openedx.core.utils.TimeUtils.formatToString
3737
import org.openedx.core.utils.clearTime
3838

39-
// --- Generic composables for reusability ---
40-
4139
@Composable
4240
private fun CourseDateBlockSectionGeneric(
4341
sectionKey: DatesSection = DatesSection.NONE,
44-
useRelativeDates: Boolean,
4542
content: @Composable () -> Unit
4643
) {
4744
Column(modifier = Modifier.padding(start = 8.dp)) {
@@ -87,7 +84,7 @@ fun CourseDateBlockSection(
8784
sectionDates: List<CourseDateBlock>,
8885
onItemClick: (CourseDateBlock) -> Unit,
8986
) {
90-
CourseDateBlockSectionGeneric(sectionKey = sectionKey, useRelativeDates = useRelativeDates) {
87+
CourseDateBlockSectionGeneric(sectionKey = sectionKey) {
9188
DateBlock(
9289
dateBlocks = sectionDates,
9390
onItemClick = onItemClick,
@@ -104,7 +101,7 @@ fun CourseDateBlockSection(
104101
sectionDates: List<CourseDate>,
105102
onItemClick: (CourseDate) -> Unit,
106103
) {
107-
CourseDateBlockSectionGeneric(sectionKey = sectionKey, useRelativeDates = useRelativeDates) {
104+
CourseDateBlockSectionGeneric(sectionKey = sectionKey) {
108105
DateBlock(
109106
dateBlocks = sectionDates,
110107
onItemClick = onItemClick,

dates/src/main/java/org/openedx/dates/domain/interactor/DatesInteractor.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ class DatesInteractor(
1111
suspend fun getUserDatesFromCache() = repository.getUserDatesFromCache()
1212

1313
suspend fun shiftDueDate(courseIds: List<String>) = repository.shiftDueDate(courseIds)
14-
1514
}

dates/src/main/java/org/openedx/dates/presentation/dates/DatesFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class DatesFragment : Fragment() {
128128
companion object {
129129
const val LOAD_MORE_THRESHOLD = 4
130130
}
131-
132131
}
133132

134133
@OptIn(ExperimentalMaterialApi::class)

dates/src/main/java/org/openedx/dates/presentation/dates/DatesViewModel.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ class DatesViewModel(
6767
isRefreshing = refresh,
6868
)
6969
}
70-
if (refresh) {
71-
page = 1
72-
}
70+
if (refresh) page = 1
7371
val response = if (networkConnection.isOnline() || page > 1) {
7472
datesInteractor.getUserDates(page)
7573
} else {

dates/src/test/java/org/openedx/dates/DatesViewModelTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,4 @@ class DatesViewModelTest {
364364
// After refresh, isRefreshing should be false.
365365
assertFalse(viewModel.uiState.value.isRefreshing)
366366
}
367-
}
367+
}

0 commit comments

Comments
 (0)