diff --git a/app/components/App.js b/app/components/App.js index 06ea6e3ad..34fbf5574 100644 --- a/app/components/App.js +++ b/app/components/App.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { View, PanResponder, Navigator, AppState } from 'react-native'; -import { reaction, action } from 'mobx'; +import { reaction, action, spy } from 'mobx'; import { observer } from 'mobx-react/native'; import Login from './login/login'; import Signup from './signup/signup'; @@ -63,7 +63,7 @@ export default class App extends Component { console.error = console._errorOriginal; } - !__DEV__ && global.ErrorUtils && global.ErrorUtils.setGlobalHandler((...args) => { + global.ErrorUtils && global.ErrorUtils.setGlobalHandler((...args) => { console.error('App.js: unhandled error'); console.error(args); }); @@ -92,7 +92,11 @@ export default class App extends Component { if (appState !== 'active') { icebear.socket.close(); } else { - icebear.socket.open(); + // spy((event) => { + // console.log('app.js spy'); + // console.log(event); + // }); + setTimeout(() => icebear.socket.open(), 2000); } } diff --git a/app/components/files/file-progress.js b/app/components/files/file-progress.js index c356bc6ff..322350b54 100644 --- a/app/components/files/file-progress.js +++ b/app/components/files/file-progress.js @@ -1,15 +1,17 @@ import React, { Component } from 'react'; import { View, + Dimensions, Animated } from 'react-native'; import { observable, autorun, reaction } from 'mobx'; import { observer } from 'mobx-react/native'; import { vars } from '../../styles/styles'; -@observer +const width = Dimensions.get('window').width; + export default class FileProgress extends Component { - @observable width = 0; + // @observable width = 0; prevFile = null; get hidden() { @@ -27,13 +29,14 @@ export default class FileProgress extends Component { if (file.uploading) { max = file.progressMax | 1; } - return (this.width * file.progress / max) | 0; + // console.log(`file-progress.js: ${file.progress}, ${file.progressMax}`); + return (width * file.progress / max); } progress = new Animated.Value(0); layout(evt) { - this.width = evt.nativeEvent.layout.width; + // this.width = evt.nativeEvent.layout.width; reaction(() => this.props.file, file => { if (file !== this.prevFile) { this.prevFile = file; @@ -41,13 +44,15 @@ export default class FileProgress extends Component { } }, true); autorun(() => { - if (this.hidden) return; + if (this.hidden) { + this.progress.setValue(0); + return; + } const toValue = this.value; - const duration = 3000; - console.log(this.progress); - toValue < this.progress._toValue ? - this.progress.setValue(0) : - Animated.timing(this.progress, { toValue, duration }).start(); + // console.log(`file-progress.js: ${toValue}`); + const duration = 100; + // this.progress.setValue(toValue); + Animated.timing(this.progress, { toValue, duration }).start(); }); } @@ -58,7 +63,7 @@ export default class FileProgress extends Component { marginTop: -height, height, backgroundColor: '#CFCFCF', - flex: 1 + width }; const pbProgress = { height, diff --git a/app/components/helpers/imagepicker.js b/app/components/helpers/imagepicker.js index b2290081a..655c2d2b7 100644 --- a/app/components/helpers/imagepicker.js +++ b/app/components/helpers/imagepicker.js @@ -27,7 +27,7 @@ export default { } else { source = { uri: response.uri, isStatic: true }; } - console.log('imagepicker.js: ', source); + // console.log('imagepicker.js: ', source); fileStore.upload(source.uri); // console.log(`imagepicker.js: id ${file.id}`); // console.log(`imagepicker.js: fileId ${file.fileId}`); diff --git a/app/components/layout/state.js b/app/components/layout/state.js index ce6cfebbe..36f7fbb05 100644 --- a/app/components/layout/state.js +++ b/app/components/layout/state.js @@ -51,10 +51,10 @@ const state = observable({ }, @action hideKeyboard() { - if (state.focusedTextBox) { - state.focusedTextBox.blur(); - state.focusedTextBox = null; - } + // if (state.focusedTextBox) { + // // state.focusedTextBox.blur(); + // state.focusedTextBox = null; + // } dismissKeyboard(); setTimeout(() => { state.pickerVisible = false; }, 0); }, diff --git a/app/components/main/main-state.js b/app/components/main/main-state.js index 9710a7f0d..e7aa00c16 100644 --- a/app/components/main/main-state.js +++ b/app/components/main/main-state.js @@ -129,7 +129,7 @@ const mainState = observable({ const file = i || this.currentFile; if (!file) return; if (file.downloading || file.uploading) return; - file.download(); + file.download().catch(e => console.error(e)); }, @action deleteFile(i) { diff --git a/ios/peeriomobile.xcodeproj/project.pbxproj b/ios/peeriomobile.xcodeproj/project.pbxproj index 4aad89c6c..fd6836e37 100644 --- a/ios/peeriomobile.xcodeproj/project.pbxproj +++ b/ios/peeriomobile.xcodeproj/project.pbxproj @@ -914,7 +914,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "export NODE_BINARY=node\n# ../node_modules/react-native/packager/react-native-xcode.sh\ncd $SRCROOT/..\nsource env.sh\n# clean up\nrm -f ios/main.jsbundle\nif [ \"$CONFIGURATION\" == \"Debug\" ]; then\n ./node_modules/.bin/react-native bundle --entry-file index.ios.js --bundle-output ios/main.jsbundle --assets-dest \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\" --platform ios --reset-cache\nfi\nif [ \"$CONFIGURATION\" == \"Release\" ]; then\n ./node_modules/.bin/react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --assets-dest \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\" --platform ios --reset-cache\nfi\n# check that command was successful\n\nif [ ! -f ios/main.jsbundle ]; then\n echo \"JS compilation failed. Please check the sources\"\n exit 1\nfi\n"; + shellScript = "export NODE_BINARY=node\n\n# ../node_modules/react-native/packager/react-native-xcode.sh\ncd $SRCROOT/..\nsource env.sh\n# clean up\nrm -f ios/main.jsbundle\nif [ \"$CONFIGURATION\" == \"Debug\" ]; then\n ./node_modules/.bin/react-native bundle --entry-file index.ios.js --bundle-output ios/main.jsbundle --assets-dest \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\" --platform ios --reset-cache\nfi\nif [ \"$CONFIGURATION\" == \"Release\" ]; then\n ./node_modules/.bin/react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --assets-dest \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\" --platform ios --reset-cache\nfi\n# check that command was successful\n\nif [ ! -f ios/main.jsbundle ]; then\n echo \"JS compilation failed. Please check the sources\"\n exit 1\nfi\n"; }; 02DB415B1DCD1DB000E04176 /* Bundle React Native code and images */ = { isa = PBXShellScriptBuildPhase; @@ -1067,7 +1067,7 @@ CODE_SIGN_ENTITLEMENTS = peeriomobile/peeriomobile.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 151; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = 7L45B96YPK; HEADER_SEARCH_PATHS = ( @@ -1120,7 +1120,7 @@ CODE_SIGN_ENTITLEMENTS = peeriomobile/peeriomobile.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 149; + CURRENT_PROJECT_VERSION = 151; DEVELOPMENT_TEAM = 7L45B96YPK; HEADER_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/peeriomobile/Info-Expandoo.plist b/ios/peeriomobile/Info-Expandoo.plist index 3ad629a4d..54d644edf 100644 --- a/ios/peeriomobile/Info-Expandoo.plist +++ b/ios/peeriomobile/Info-Expandoo.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 149 + 151 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/ios/peeriomobile/Info.plist b/ios/peeriomobile/Info.plist index bbea20a01..343059e85 100644 --- a/ios/peeriomobile/Info.plist +++ b/ios/peeriomobile/Info.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 149 + 151 ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode diff --git a/shim.js b/shim.js index 255f890ab..cb357ee86 100644 --- a/shim.js +++ b/shim.js @@ -30,6 +30,5 @@ global.WebSocket = function(url) { }; // global.WebSocket = global.originalWebSocket; -const ws = new WebSocket('ws://localhost:8081') -console.log('shim.js binaryType: ', ws.binaryType); +// console.log('shim.js binaryType: ', ws.binaryType); // console.log('shim.js: ', global.originalWebSocket);