From 22cb7cd540f212dab1714683d66c95122a84929d Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Tue, 30 Jul 2019 02:50:49 -0700 Subject: [PATCH] node/browser constant --- js/modules/loki_friend_request_status.js | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 js/modules/loki_friend_request_status.js diff --git a/js/modules/loki_friend_request_status.js b/js/modules/loki_friend_request_status.js new file mode 100644 index 000000000..c7896c0da --- /dev/null +++ b/js/modules/loki_friend_request_status.js @@ -0,0 +1,25 @@ +const friendRequestStatusEnum = Object.freeze({ + // New conversation, no messages sent or received + none: 0, + // This state is used to lock the input early while sending + pendingSend: 1, + // Friend request sent, awaiting response + requestSent: 2, + // Friend request received, awaiting user input + requestReceived: 3, + // We did it! + friends: 4, + // Friend Request sent but timed out + requestExpired: 5, +}); + +// node and browser compatibility +(function exportLocalVariable(ref) { + if (ref.constructor.name === 'Module') { + // node + module.exports = friendRequestStatusEnum; + } else { + // browser + // friendRequestStatusEnum should be already set + } +})(typeof module === 'undefined' ? this : module);