From e31fe4cfd2a0eefe10d3ef8894dfad37a5d26c9b Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Thu, 12 Jul 2018 08:54:49 -0500 Subject: [PATCH] Updates --- src/ApplicationState.js | 2 +- src/global.js | 23 ++++++++++++++++++++++- src/lib/sfjs/storageManager.js | 7 ------- src/screens/Account.js | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/ApplicationState.js b/src/ApplicationState.js index 5a781044..72d38858 100644 --- a/src/ApplicationState.js +++ b/src/ApplicationState.js @@ -99,7 +99,7 @@ export default class ApplicationState { } } - // An app cycle change are natural events like active, inactive, background, + // An app cycle change are natural events like active, inactive, background, // while non-app cycle events are custom events like locking and unlocking isStateAppCycleChange(state) { diff --git a/src/global.js b/src/global.js index ac2a6e2e..0f17f035 100644 --- a/src/global.js +++ b/src/global.js @@ -1,3 +1,14 @@ +// Apparently Android doesn't support symbols. +// https://github.com/facebook/react-native/issues/15902 +// symbol polyfills +global.Symbol = require('core-js/es6/symbol'); +require('core-js/fn/symbol/iterator'); + +// collection fn polyfills +require('core-js/fn/map'); +require('core-js/fn/set'); +require('core-js/fn/array/find'); + global._ = require('lodash'); import { @@ -23,4 +34,14 @@ global.SFAuthManager = SFAuthManager; import SF from "./lib/sfjs/sfjs" global.SFJS = SF.get(); -import 'sn-models'; +import { + SNNote, + SNTag, + SNTheme, + SNComponent +} from 'sn-models'; + +global.SNNote = SNNote; +global.SNTag = SNTag; +global.SNTheme = SNTheme; +global.SNComponent = SNComponent; diff --git a/src/lib/sfjs/storageManager.js b/src/lib/sfjs/storageManager.js index 0da740fd..3452489b 100644 --- a/src/lib/sfjs/storageManager.js +++ b/src/lib/sfjs/storageManager.js @@ -12,13 +12,6 @@ export default class Storage extends SFStorageManager { return this.instance; } - constructor() { - super(); - AsyncStorage.getAllKeys().then((keys) => { - console.log("all model keys", keys); - }) - } - async getItem(key) { try { return AsyncStorage.getItem(key); diff --git a/src/screens/Account.js b/src/screens/Account.js index b8f07ed8..82aed527 100644 --- a/src/screens/Account.js +++ b/src/screens/Account.js @@ -395,7 +395,7 @@ export default class Account extends Abstract { this.resaveOfflineData(null, true); } - this.mergeState({hasPasscode: !result}); + this.mergeState({hasPasscode: false}); this.forceUpdate(); } })