mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
ios, android: cancel file UI; core: cancel file fixes (#2100)
backend fixes: - check file is not complete on CancelFile, - check file is not cancelled when processing XFTP events, - mark SMP file cancelled if recipient cancelled in direct chat.
This commit is contained in:
@@ -770,7 +770,7 @@ data ChatErrorType
|
||||
| CEFileNotFound {message :: String}
|
||||
| CEFileAlreadyReceiving {message :: String}
|
||||
| CEFileCancelled {message :: String}
|
||||
| CEFileAlreadyCancelled {fileId :: FileTransferId}
|
||||
| CEFileCancel {fileId :: FileTransferId, message :: String}
|
||||
| CEFileAlreadyExists {filePath :: FilePath}
|
||||
| CEFileRead {filePath :: FilePath, message :: String}
|
||||
| CEFileWrite {filePath :: FilePath, message :: String}
|
||||
|
||||
@@ -1614,6 +1614,11 @@ instance ToJSON RcvFileStatus where
|
||||
toJSON = J.genericToJSON . sumTypeJSON $ dropPrefix "RFS"
|
||||
toEncoding = J.genericToEncoding . sumTypeJSON $ dropPrefix "RFS"
|
||||
|
||||
rcvFileComplete :: RcvFileStatus -> Bool
|
||||
rcvFileComplete = \case
|
||||
RFSComplete _ -> True
|
||||
_ -> False
|
||||
|
||||
data RcvFileInfo = RcvFileInfo
|
||||
{ filePath :: FilePath,
|
||||
connId :: Maybe Int64,
|
||||
|
||||
@@ -1274,7 +1274,7 @@ viewChatError logLevel = \case
|
||||
CEFileNotFound f -> ["file not found: " <> plain f]
|
||||
CEFileAlreadyReceiving f -> ["file is already being received: " <> plain f]
|
||||
CEFileCancelled f -> ["file cancelled: " <> plain f]
|
||||
CEFileAlreadyCancelled fileId -> ["file already cancelled: " <> sShow fileId]
|
||||
CEFileCancel fileId e -> ["error cancelling file " <> sShow fileId <> ": " <> sShow e]
|
||||
CEFileAlreadyExists f -> ["file already exists: " <> plain f]
|
||||
CEFileRead f e -> ["cannot read file " <> plain f, sShow e]
|
||||
CEFileWrite f e -> ["cannot write file " <> plain f, sShow e]
|
||||
|
||||
Reference in New Issue
Block a user