mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Don't flash previous app content when resuming app & auto sign-in is off (#585)
## Description When the app is put into the background with auto sign-in disabled, it will remove the current page and show a loading indicator. This way when the app is resumed, the previous content won't flash on screen for a split second. The above should technically fix #584 on its own, but as additional safe guide, this PR also makes sure the `ApiClient` is configured before trying to create image URLs. ### Related issues Fixes #584
This commit is contained in:
parent
494ff07b72
commit
639ce0de71
4 changed files with 38 additions and 12 deletions
|
|
@ -31,7 +31,7 @@ class ImageUrlService
|
|||
imageType: ImageType,
|
||||
fillWidth: Int? = null,
|
||||
fillHeight: Int? = null,
|
||||
): String =
|
||||
): String? =
|
||||
when (imageType) {
|
||||
ImageType.BACKDROP,
|
||||
ImageType.LOGO,
|
||||
|
|
@ -124,8 +124,9 @@ class ImageUrlService
|
|||
backgroundColor: String? = null,
|
||||
foregroundLayer: String? = null,
|
||||
imageIndex: Int? = null,
|
||||
): String =
|
||||
api.imageApi.getItemImageUrl(
|
||||
): String? {
|
||||
if (api.baseUrl.isNullOrBlank()) return null
|
||||
return api.imageApi.getItemImageUrl(
|
||||
itemId = itemId,
|
||||
imageType = imageType,
|
||||
maxWidth = maxWidth,
|
||||
|
|
@ -144,6 +145,7 @@ class ImageUrlService
|
|||
foregroundLayer = foregroundLayer,
|
||||
imageIndex = imageIndex,
|
||||
)
|
||||
}
|
||||
|
||||
fun getUserImageUrl(userId: UUID) = api.imageApi.getUserImageUrl(userId)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue