This commit is contained in:
davidoskky 2023-01-27 00:25:27 +01:00
parent c80177377c
commit ec0fd2faee
3 changed files with 5 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class ReaderActivity : AppCompatActivity(), DIAware {
} }
private fun readItem(item: SelfossModel.Item) { private fun readItem(item: SelfossModel.Item) {
if (appSettingsService.isMarkOnScrollEnabled() and !appSettingsService.getPublicAccess()) { if (appSettingsService.isMarkOnScrollEnabled() && !appSettingsService.getPublicAccess()) {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
repository.markAsRead(item) repository.markAsRead(item)
} }

View File

@ -51,7 +51,7 @@ class SelfossModel {
fun getApiConfiguration() = configuration ?: ApiConfiguration(null, null) fun getApiConfiguration() = configuration ?: ApiConfiguration(null, null)
} }
@kotlinx.serialization.Serializable @Serializable
data class ApiConfiguration( data class ApiConfiguration(
@Serializable(with = BooleanSerializer::class) @Serializable(with = BooleanSerializer::class)
val publicMode: Boolean?, val publicMode: Boolean?,

View File

@ -448,6 +448,9 @@ class Repository(
if (fetchedInformation.data.getApiMajorVersion() != apiMajorVersion) { if (fetchedInformation.data.getApiMajorVersion() != apiMajorVersion) {
appSettingsService.updateApiVersion(fetchedInformation.data.getApiMajorVersion()) appSettingsService.updateApiVersion(fetchedInformation.data.getApiMajorVersion())
} }
// Check if we're accessing the instance in public mode
// This happens when auth and public mode are enabled but
// no credentials are provided to login
if (appSettingsService.getUserName().isEmpty() if (appSettingsService.getUserName().isEmpty()
&& fetchedInformation.data.getApiConfiguration().isAuthEnabled() && fetchedInformation.data.getApiConfiguration().isAuthEnabled()
&& fetchedInformation.data.getApiConfiguration().isPublicModeEnabled()) { && fetchedInformation.data.getApiConfiguration().isPublicModeEnabled()) {