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:
parent
f0ffb8127e
commit
041bfd9f57
3 changed files with 13 additions and 0 deletions
|
@ -10,4 +10,7 @@ sealed class FileLimitsEvent {
|
|||
val spaceId: String,
|
||||
val fileId: String
|
||||
) : FileLimitsEvent()
|
||||
data class FileLimitUpdated(
|
||||
val bytesLimit: Long
|
||||
) : FileLimitsEvent()
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,9 @@ class FilesStorageViewModel(
|
|||
is FileLimitsEvent.SpaceUsage -> newState.copy(
|
||||
bytesUsage = event.bytesUsage
|
||||
)
|
||||
is FileLimitsEvent.FileLimitUpdated -> newState.copy(
|
||||
bytesLimit = event.bytesLimit
|
||||
)
|
||||
else -> newState
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue