diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-12-28 08:59:23 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-12-28 08:59:23 -0500 |
commit | 0b55c5f86186ee5cce9cf29f3f560b2dd5b15277 (patch) | |
tree | ada7aa42d9102fabbcd0e91979be63de8dfed08f /web/react/utils/async_client.jsx | |
parent | f9f6b0cea3e16038aacb454486a7f9fec037127a (diff) | |
parent | cfdc5ab9998a86a8b540d8f5d5a7b429e919e4d6 (diff) | |
download | chat-0b55c5f86186ee5cce9cf29f3f560b2dd5b15277.tar.gz chat-0b55c5f86186ee5cce9cf29f3f560b2dd5b15277.tar.bz2 chat-0b55c5f86186ee5cce9cf29f3f560b2dd5b15277.zip |
Merge pull request #1755 from hmhealey/plt1108
PLT-1108 Refactored ViewImage modal and made it automatically play animated gifs
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r-- | web/react/utils/async_client.jsx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index 88b5aa739..f218270da 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -769,3 +769,31 @@ export function getSuggestedCommands(command, suggestionId, component) { } ); } + +export function getFileInfo(filename) { + const callName = 'getFileInfo' + filename; + + if (isCallInProgress(callName)) { + return; + } + + callTracker[callName] = utils.getTimestamp(); + + client.getFileInfo( + filename, + (data) => { + callTracker[callName] = 0; + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECIEVED_FILE_INFO, + filename, + info: data + }); + }, + (err) => { + callTracker[callName] = 0; + + dispatchError(err, 'getFileInfo'); + } + ); +} |