1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2436 Protocol | Support FileLimitsUpdated event (#1141)

This commit is contained in:
Konstantin Ivanov 2024-04-19 13:15:12 +02:00 committed by konstantiniiv
parent f0ffb8127e
commit 041bfd9f57
3 changed files with 13 additions and 0 deletions

View file

@ -10,4 +10,7 @@ sealed class FileLimitsEvent {
val spaceId: String,
val fileId: String
) : FileLimitsEvent()
data class FileLimitUpdated(
val bytesLimit: Long
) : FileLimitsEvent()
}

View file

@ -38,6 +38,13 @@ class FileLimitsMiddlewareChannel(
spaceId = event.spaceId
)
}
message.fileLimitUpdated != null -> {
val event = message.fileLimitUpdated
checkNotNull(event)
FileLimitsEvent.FileLimitUpdated(
bytesLimit = event.bytesLimit
)
}
else -> null
}
}

View file

@ -146,6 +146,9 @@ class FilesStorageViewModel(
is FileLimitsEvent.SpaceUsage -> newState.copy(
bytesUsage = event.bytesUsage
)
is FileLimitsEvent.FileLimitUpdated -> newState.copy(
bytesLimit = event.bytesLimit
)
else -> newState
}
}