mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Display the store sizes under the developer options menu
This commit is contained in:
committed by
Stefan Ceriu
parent
8a1d0fe8b1
commit
53a20f2a89
@@ -4707,6 +4707,70 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
|
||||
return optimizeStoresReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - storeSizes
|
||||
|
||||
var storeSizesUnderlyingCallsCount = 0
|
||||
var storeSizesCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return storeSizesUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = storeSizesUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
storeSizesUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
storeSizesUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var storeSizesCalled: Bool {
|
||||
return storeSizesCallsCount > 0
|
||||
}
|
||||
|
||||
var storeSizesUnderlyingReturnValue: Result<StoreSizes, ClientProxyError>!
|
||||
var storeSizesReturnValue: Result<StoreSizes, ClientProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return storeSizesUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<StoreSizes, ClientProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = storeSizesUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
storeSizesUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
storeSizesUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var storeSizesClosure: (() async -> Result<StoreSizes, ClientProxyError>)?
|
||||
|
||||
func storeSizes() async -> Result<StoreSizes, ClientProxyError> {
|
||||
storeSizesCallsCount += 1
|
||||
if let storeSizesClosure = storeSizesClosure {
|
||||
return await storeSizesClosure()
|
||||
} else {
|
||||
return storeSizesReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - fetchMediaPreviewConfiguration
|
||||
|
||||
var fetchMediaPreviewConfigurationUnderlyingCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user