summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-12-18 12:14:15 -0500
committerhmhealey <harrisonmhealey@gmail.com>2015-12-18 12:51:04 -0500
commit46a59252b655a9c2e05febd6b5e948bb5dbf81fb (patch)
tree2a41b4ed0f459f9c8890030ccb3b2c3fee54e1c8 /web/react/utils/async_client.jsx
parentd4a139c09afa5fc0bcdcd1276cf0d2121dbdd226 (diff)
downloadchat-46a59252b655a9c2e05febd6b5e948bb5dbf81fb.tar.gz
chat-46a59252b655a9c2e05febd6b5e948bb5dbf81fb.tar.bz2
chat-46a59252b655a9c2e05febd6b5e948bb5dbf81fb.zip
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.jsx28
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');
+ }
+ );
+}