summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-05-05 16:35:03 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-05 16:35:03 -0400
commitd2ddf40f56191c1770c3ca93d747a7f1b749f26c (patch)
tree9cd5d9ac9fc5b9da21fba8df9990c5f927801272 /webapp/utils
parent696ffb4745bec6306f88c5693b8ded89a47f5de7 (diff)
downloadchat-d2ddf40f56191c1770c3ca93d747a7f1b749f26c.tar.gz
chat-d2ddf40f56191c1770c3ca93d747a7f1b749f26c.tar.bz2
chat-d2ddf40f56191c1770c3ca93d747a7f1b749f26c.zip
PLT-2600/PLT-2770 Added Get Public Link modal and added new API for public file links (#2892)
* Switched public file links to use a GetLinkModal * Separated getFile and the new getPublicFile api calls
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx30
-rw-r--r--webapp/utils/constants.jsx1
2 files changed, 31 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
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 3ae99d7fa..fb4086c7a 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -110,6 +110,7 @@ export default {
TOGGLE_GET_POST_LINK_MODAL: null,
TOGGLE_GET_TEAM_INVITE_LINK_MODAL: null,
TOGGLE_REGISTER_APP_MODAL: null,
+ TOGGLE_GET_PUBLIC_LINK_MODAL: null,
SUGGESTION_PRETEXT_CHANGED: null,
SUGGESTION_RECEIVED_SUGGESTIONS: null,