From d1157c4d72533325ab6372a943a7eb760dd35e98 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 17 Aug 2017 16:28:54 +0200 Subject: [PATCH] Add missing file --- www/common/sframe-common.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 www/common/sframe-common.js diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js new file mode 100644 index 000000000..58dda18b1 --- /dev/null +++ b/www/common/sframe-common.js @@ -0,0 +1,23 @@ +define([ + 'jquery', + '/common/sframe-chainpad-netflux-inner.js', + +], function ($, CpNfInner) { + var common = {}; + var cpNfInner; + + // Chainpad Netflux Inner + common.startRealtime = function (options) { + if (cpNfInner) { return cpNfInner; } + cpNfInner = CpNfInner.start(options); + return cpNfInner; + }; + + + common.isLoggedIn = function () { + if (!cpNfInner) { throw new Error("cpNfInner is not ready!"); } + return cpNfInner.metadataMgr.getPrivateData().accountName; + }; + + return common; +});