summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
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,