diff --git a/appasar/canary/app_bootstrap/data/quotes_copy.json b/appasar/canary/app_bootstrap/data/quotes_copy.json index a8fb7fa..fc33384 100644 --- a/appasar/canary/app_bootstrap/data/quotes_copy.json +++ b/appasar/canary/app_bootstrap/data/quotes_copy.json @@ -1,15 +1,14 @@ [ - "Leeeeeeroy jenkins!", - "Readying the felines.", - "Ensuring dankest memes.", - "Recruiting robot hamsters.", - "Getting dunked.", - "Summoning unnecessarily dramatic encounters.", - "Procedurally generating buttons.", - "Preparing for a team fight.", - "Buffing before the raid.", - "Top decking lethal.", - "Reloading the R8.", - "Constructing additional pylons.", - "Unbenching the Kench." + "Upsorbing the Contents", + "Additive Parsing the Load", + "Commence Monosaturated Goodening", + "Kick Off the Multi-Core Widening", + "Bastening the Game Turkey", + "Abstracting the Rummage Disc", + "Undecerealenizing the Process", + "Postrefragmenting the Widget Layer", + "Satisfying the Constraints", + "Abnoramalzing Some of the Matrices", + "Optimizing the People", + "Proclaigerizing the Network" ] diff --git a/appasar/canary/app_bootstrap/splash/index.js b/appasar/canary/app_bootstrap/splash/index.js index 37b3927..737b244 100644 --- a/appasar/canary/app_bootstrap/splash/index.js +++ b/appasar/canary/app_bootstrap/splash/index.js @@ -22554,6 +22554,9 @@ const Splash = _react2.default.createClass({ ipcRenderer.on('SPLASH_UPDATE_STATE', (_e, state) => { this.setState({ update: state }); }); + ipcRenderer.on('SPLASH_SCREEN_QUOTE', (_e, quote) => { + this.setState({ quote }); + }); ipcRenderer.send('SPLASH_SCREEN_READY'); }, @@ -25703,7 +25706,7 @@ module.exports = require("electron"); /* 199 */ /***/ (function(module, exports) { -module.exports = ["Leeeeeeroy jenkins!","Readying the felines.","Ensuring dankest memes.","Recruiting robot hamsters.","Getting dunked.","Summoning unnecessarily dramatic encounters.","Procedurally generating buttons.","Preparing for a team fight.","Buffing before the raid.","Top decking lethal.","Reloading the R8.","Constructing additional pylons.","Unbenching the Kench."] +module.exports = ["Upsorbing the Contents","Additive Parsing the Load","Commence Monosaturated Goodening","Kick Off the Multi-Core Widening","Bastening the Game Turkey","Abstracting the Rummage Disc","Undecerealenizing the Process","Postrefragmenting the Widget Layer","Satisfying the Constraints","Abnoramalzing Some of the Matrices","Optimizing the People","Proclaigerizing the Network"] /***/ }), /* 200 */ diff --git a/appasar/canary/app_bootstrap/splashScreen.js b/appasar/canary/app_bootstrap/splashScreen.js index 96d7b19..e068dac 100644 --- a/appasar/canary/app_bootstrap/splashScreen.js +++ b/appasar/canary/app_bootstrap/splashScreen.js @@ -31,6 +31,14 @@ var _ipcMain = require('./ipcMain'); var _ipcMain2 = _interopRequireDefault(_ipcMain); +var _paths = require('../common/paths'); + +var paths = _interopRequireWildcard(_paths); + +var _fs = require('fs'); + +var _fs2 = _interopRequireDefault(_fs); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -77,6 +85,7 @@ let updateTimeout; let updateAttempt; let splashState; let launchedMainWindow; +let quoteCachePath; function initSplash(startMinimized = false) { modulesListeners = {}; @@ -144,6 +153,9 @@ function initSplash(startMinimized = false) { }); launchSplashWindow(startMinimized); + + quoteCachePath = _path2.default.join(paths.getUserData(), 'quotes.json'); + _ipcMain2.default.on('UPDATED_QUOTES', (_event, quotes) => cacheLatestQuotes(quotes)); } function destroySplash() { @@ -228,6 +240,11 @@ function launchSplashWindow(startMinimized) { } _ipcMain2.default.on('SPLASH_SCREEN_READY', () => { + let cachedQuote = chooseCachedQuote(); + if (cachedQuote) { + webContentsSend(splashWindow, 'SPLASH_SCREEN_QUOTE', cachedQuote); + } + if (splashWindow && !startMinimized) { splashWindow.show(); } @@ -268,4 +285,21 @@ function focusWindow() { function pageReady() { destroySplash(); process.nextTick(() => events.emit(APP_SHOULD_SHOW)); +} + +function cacheLatestQuotes(quotes) { + _fs2.default.writeFile(quoteCachePath, JSON.stringify(quotes), e => { + if (e) { + console.warn('Failed updating quote cache with error: ', e); + } + }); +} + +function chooseCachedQuote() { + let cachedQuote = null; + try { + const cachedQuotes = JSON.parse(_fs2.default.readFileSync(quoteCachePath)); + cachedQuote = cachedQuotes[Math.floor(Math.random() * cachedQuotes.length)]; + } catch (_err) {} + return cachedQuote; } \ No newline at end of file