diff --git a/Assets/macOs.iconset/icon_512x512@2x.png b/Assets/macOs.iconset/icon_512x512@2x.png index b5df3b305..91a697770 100644 Binary files a/Assets/macOs.iconset/icon_512x512@2x.png and b/Assets/macOs.iconset/icon_512x512@2x.png differ diff --git a/ReactNativeClient/images/StartUpIcon.png b/ReactNativeClient/images/StartUpIcon.png deleted file mode 100644 index f8aaac554..000000000 Binary files a/ReactNativeClient/images/StartUpIcon.png and /dev/null differ diff --git a/ReactNativeClient/images/StartUpIcon@2x.png b/ReactNativeClient/images/StartUpIcon@2x.png deleted file mode 100644 index fc1df0176..000000000 Binary files a/ReactNativeClient/images/StartUpIcon@2x.png and /dev/null differ diff --git a/ReactNativeClient/images/StartUpIcon@3x.png b/ReactNativeClient/images/StartUpIcon@3x.png deleted file mode 100644 index e7b23d6da..000000000 Binary files a/ReactNativeClient/images/StartUpIcon@3x.png and /dev/null differ diff --git a/ReactNativeClient/lib/joplin-database.js b/ReactNativeClient/lib/joplin-database.js index fd6a81f37..2f44e4895 100644 --- a/ReactNativeClient/lib/joplin-database.js +++ b/ReactNativeClient/lib/joplin-database.js @@ -3,7 +3,6 @@ const { Database } = require('lib/database.js'); const { sprintf } = require('sprintf-js'); const Resource = require('lib/models/Resource'); const { shim } = require('lib/shim.js'); -const EventEmitter = require('events'); const structureSql = ` CREATE TABLE folders ( @@ -127,11 +126,6 @@ class JoplinDatabase extends Database { this.version_ = null; this.tableFieldNames_ = {}; this.extensionToLoad = './build/lib/sql-extensions/spellfix'; - this.eventEmitter_ = new EventEmitter(); - } - - eventEmitter() { - return this.eventEmitter_; } initialized() { @@ -361,8 +355,6 @@ class JoplinDatabase extends Database { let queries = []; - this.eventEmitter_.emit('startMigration', { version: targetVersion }); - if (targetVersion == 1) { queries = this.wrapQueries(this.sqlStringToLines(structureSql)); } diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index e8606f671..7362552c3 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -2,7 +2,7 @@ import setUpQuickActions from './setUpQuickActions'; import PluginAssetsLoader from './PluginAssetsLoader'; const React = require('react'); -const { AppState, Keyboard, NativeModules, BackHandler, Animated, View, StatusBar, Text, Image } = require('react-native'); +const { AppState, Keyboard, NativeModules, BackHandler, Animated, View, StatusBar } = require('react-native'); const SafeAreaView = require('lib/components/SafeAreaView'); const { connect, Provider } = require('react-redux'); const { BackButtonService } = require('lib/services/back-button.js'); @@ -376,7 +376,7 @@ function decryptionWorker_resourceMetadataButNotBlobDecrypted() { ResourceFetcher.instance().scheduleAutoAddResources(); } -async function initialize(dispatch, messageHandler) { +async function initialize(dispatch) { shimInit(); Setting.setConstant('env', __DEV__ ? 'dev' : 'prod'); @@ -415,13 +415,8 @@ async function initialize(dispatch, messageHandler) { dbLogger.setLevel(Logger.LEVEL_INFO); } - const db_startUpgrade = (event) => { - messageHandler(`Upgrading database to v${event.version}...`); - }; - const db = new JoplinDatabase(new DatabaseDriverReactNative()); db.setLogger(dbLogger); - db.eventEmitter().on('startMigration', db_startUpgrade); reg.setDb(db); reg.dispatch = dispatch; @@ -458,13 +453,9 @@ async function initialize(dispatch, messageHandler) { // await db.clearForTesting(); } - db.eventEmitter().removeListener('startMigration', db_startUpgrade); - reg.logger().info('Database is ready.'); reg.logger().info('Loading settings...'); - messageHandler('Initialising application...'); - await loadKeychainServiceAndSettings(KeychainServiceDriverMobile); if (!Setting.value('clientId')) Setting.setValue('clientId', uuid.create()); @@ -611,7 +602,6 @@ class AppComponent extends React.Component { this.state = { sideMenuContentOpacity: new Animated.Value(0), - initMessage: '', }; this.lastSyncStarted_ = defaultState.syncStarted; @@ -625,52 +615,47 @@ class AppComponent extends React.Component { }; } - componentDidMount() { - setTimeout(async () => { - // We run initialization code with a small delay to give time - // to the view to render "please wait" messages. - + async componentDidMount() { + if (this.props.appState == 'starting') { this.props.dispatch({ type: 'APP_STATE_SET', state: 'initializing', }); - await initialize(this.props.dispatch, (message) => { - this.setState({ initMessage: message }); - }); - - BackButtonService.initialize(this.backButtonHandler_); - - AlarmService.setInAppNotificationHandler(async (alarmId) => { - const alarm = await Alarm.load(alarmId); - const notification = await Alarm.makeNotification(alarm); - this.dropdownAlert_.alertWithType('info', notification.title, notification.body ? notification.body : ''); - }); - - AppState.addEventListener('change', this.onAppStateChange_); - - const sharedData = await ShareExtension.data(); - if (sharedData) { - reg.logger().info('Received shared data'); - if (this.props.selectedFolderId) { - handleShared(sharedData, this.props.selectedFolderId, this.props.dispatch); - } else { - reg.logger.info('Cannot handle share - default folder id is not set'); - } - } + await initialize(this.props.dispatch); this.props.dispatch({ type: 'APP_STATE_SET', state: 'ready', }); - }, 100); + } + + BackButtonService.initialize(this.backButtonHandler_); + + AlarmService.setInAppNotificationHandler(async (alarmId) => { + const alarm = await Alarm.load(alarmId); + const notification = await Alarm.makeNotification(alarm); + this.dropdownAlert_.alertWithType('info', notification.title, notification.body ? notification.body : ''); + }); + + AppState.addEventListener('change', this.onAppStateChange_); + + const sharedData = await ShareExtension.data(); + if (sharedData) { + reg.logger().info('Received shared data'); + if (this.props.selectedFolderId) { + handleShared(sharedData, this.props.selectedFolderId, this.props.dispatch); + } else { + reg.logger.info('Cannot handle share - default folder id is not set'); + } + } } componentWillUnmount() { AppState.removeEventListener('change', this.onAppStateChange_); } - async componentDidUpdate(prevProps) { + componentDidUpdate(prevProps) { if (this.props.showSideMenu !== prevProps.showSideMenu) { Animated.timing(this.state.sideMenuContentOpacity, { toValue: this.props.showSideMenu ? 0.5 : 0, @@ -715,19 +700,8 @@ class AppComponent extends React.Component { }); } - renderStartupScreen() { - return ( - - - - {this.state.initMessage} - - - ); - } - render() { - if (this.props.appState != 'ready') return this.renderStartupScreen(); + if (this.props.appState != 'ready') return null; const theme = themeStyle(this.props.themeId); let sideMenuContent = null; diff --git a/Tools/generate-images.js b/Tools/generate-images.js index e7e871b53..93f13ea3b 100644 --- a/Tools/generate-images.js +++ b/Tools/generate-images.js @@ -281,29 +281,6 @@ const operations = [ iconWidth: 46, iconHeight: 46, }, - - // ============================================================================ - // Mobile startup icon - // ============================================================================ - - { - source: 7, - dest: 'ReactNativeClient/images/StartUpIcon.png', - width: 64, - height: 64, - }, - { - source: 7, - dest: 'ReactNativeClient/images/StartUpIcon@2x.png', - width: 128, - height: 128, - }, - { - source: 7, - dest: 'ReactNativeClient/images/StartUpIcon@3x.png', - width: 192, - height: 192, - }, ]; async function main() { diff --git a/joplin.code-workspace b/joplin.code-workspace index 5f6075a85..ddf7130b3 100644 --- a/joplin.code-workspace +++ b/joplin.code-workspace @@ -3,7 +3,11 @@ { "name": ".", "path": "." - } + }, + { + "name": "D:/Web/www/nextcloud/apps/joplin", + "path": "D:/Web/www/nextcloud/apps/joplin" + }, ], "settings": { "files.exclude": {