diff options
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r-- | webapp/utils/async_client.jsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 57888f722..ac651a7bb 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -1343,3 +1343,33 @@ export function regenCommandToken(id) { } ); } + +export function getPublicLink(channelId, userId, filename, success, error) { + const callName = 'getPublicLink' + channelId + userId + filename; + + if (isCallInProgress(callName)) { + return; + } + + callTracker[callName] = utils.getTimestamp(); + + Client.getPublicLink( + channelId, + userId, + filename, + (link) => { + callTracker[callName] = 0; + + success(link); + }, + (err) => { + callTracker[callName] = 0; + + if (error) { + error(err); + } else { + dispatchError(err, 'getPublicLink'); + } + } + ); +}
\ No newline at end of file |