Skip to content

Commit 3604457

Browse files
committed
update(interactor): delay error
1 parent 1af212a commit 3604457

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/src/main/java/com/hoc/pagination_mvi/ui/main/MainInteractorImpl.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MainInteractorImpl @Inject constructor(
3434
.let { PhotoNextPage.Data(it) }
3535
.let { send(it) }
3636
} catch (e: Exception) {
37-
delay(500)
37+
delayError()
3838
send(PhotoNextPage.Error(e))
3939
}
4040
}
@@ -49,7 +49,7 @@ class MainInteractorImpl @Inject constructor(
4949
.let { PhotoFirstPage.Data(it) }
5050
.let { send(it) }
5151
} catch (e: Exception) {
52-
delay(500)
52+
delayError()
5353
send(PhotoFirstPage.Error(e))
5454
}
5555
}
@@ -64,7 +64,7 @@ class MainInteractorImpl @Inject constructor(
6464
.let { PostFirstPage.Data(it) }
6565
.let { send(it) }
6666
} catch (e: Exception) {
67-
delay(500)
67+
delayError()
6868
send(PostFirstPage.Error(e))
6969
}
7070
}
@@ -82,7 +82,7 @@ class MainInteractorImpl @Inject constructor(
8282
.let { PostNextPage.Data(it) }
8383
.let { send(it) }
8484
} catch (e: Exception) {
85-
delay(500)
85+
delayError()
8686
send(PostNextPage.Error(e))
8787
}
8888
}
@@ -107,9 +107,11 @@ class MainInteractorImpl @Inject constructor(
107107
)
108108
}
109109
} catch (e: Exception) {
110-
delay(500)
110+
delayError()
111111
send(Refresh.Error(e))
112112
}
113113
}
114114
}
115+
116+
private suspend fun delayError() = delay(400)
115117
}

0 commit comments

Comments
 (0)