From b94a55f655d9faa17ebc8d2ec785b570f05dd027 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 2 Nov 2017 16:32:19 -0400 Subject: [PATCH] remove old appid service --- src/services/appIdService.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/services/appIdService.js diff --git a/src/services/appIdService.js b/src/services/appIdService.js deleted file mode 100644 index a576ee236f..0000000000 --- a/src/services/appIdService.js +++ /dev/null @@ -1,36 +0,0 @@ -function AppIdService(utilsService) { - this.utilsService = utilsService; - - initAppIdService(); -} - -function initAppIdService() { - AppIdService.prototype.getAppId = function () { - return makeAndGetAppId('appId', this); - }; - - AppIdService.prototype.getAnonymousAppId = function () { - return makeAndGetAppId('anonymousAppId', this); - }; - - function makeAndGetAppId(key, self) { - return self.utilsService.getObjFromStorage(key).then(function (obj) { - if (obj) { - return obj; - } - - var guid = newGuid(); - return self.utilsService.saveObjToStorage(key, guid).then(function () { - return guid; - }); - }); - } - - // ref: http://stackoverflow.com/a/2117523/1090359 - function newGuid() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); - return v.toString(16); - }); - } -}