Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => {
this.props.eventBus.emit('hideLoading');
this.deleting = true;
Actions.pop();
let state = this.props.store.getState();
let actions = [];
if (state.app.activeSphere === this.props.sphereId)
actions.push({type:"CLEAR_ACTIVE_SPHERE"});
actions.push({type:'REMOVE_SPHERE', sphereId: this.props.sphereId});
// stop tracking sphere.
Bluenet.stopTrackingIBeacon(state.spheres[this.props.sphereId].config.iBeaconUUID);
this.props.store.batchDispatch(actions);
})
}
export default function routesReducer(state = initialState, action = {}) {
switch (action.type) {
// focus action is dispatched when a new screen comes into focus
case ActionConst.FOCUS:
console.log(action);
return {
...state,
scene: action.scene,
};
// ...other actions
default:
return state;
}
}
edgeSignedTransaction.metadata = edgeMetadata
edgeSignedTransaction.wallet = wallet
playSendSound().catch(error => console.log(error)) // Fail quietly
Alert.alert(s.strings.transaction_success, s.strings.transaction_success_message, [
{
onPress () {},
style: 'default',
text: s.strings.string_ok
}
])
if (guiMakeSpendInfo.onDone) {
guiMakeSpendInfo.onDone(null, edgeSignedTransaction)
} else {
Actions.replace(TRANSACTION_DETAILS, { edgeTransaction: edgeSignedTransaction })
}
} catch (e) {
console.log(e)
dispatch(updateSpendPending(false))
let message = sprintf(s.strings.transaction_failure_message, e.message)
if (e.name === 'ErrorEosInsufficientCpu') {
message = s.strings.send_confirmation_eos_error_cpu
} else if (e.name === 'ErrorEosInsufficientNet') {
message = s.strings.send_confirmation_eos_error_net
} else if (e.name === 'ErrorEosInsufficientRam') {
message = s.strings.send_confirmation_eos_error_ram
}
dispatch(updateTransaction(edgeSignedTransaction, null, true, new Error('broadcastError')))
Alert.alert(s.strings.transaction_failure, message, [
{
const reducerCreate = params => {
const defaultReducer = new Reducer(params);
return (state, action) => {
// console.log('ACTION:',action,Actions.currentScene)
// console.log('Actions:', Actions);
return defaultReducer(state, action);
};
};
this._service.onLogin((/* err, */ /* res */) => {
// console.log('onLogink', err, res, this._service.service.loggedInUser);
if (this._mounted && this._service.service.loggedInUser) {
if (this._service.service.loggedInUser.username) {
Actions.app({ type: 'reset' });
}
}
});
this._mounted = true;
}, () => {
// console.log('RegCB 01', lerr, lres);
if (this._net.service.loggedInUser && this._net.service.loggedInUser.username) {
Actions.app({ type: 'reset' });
} else {
this.setState({ setUsername: true, alert: { success: '' } });
this._net.service.getUsernameSuggestion((Uerr, Ures) => {
if (Uerr) {
this.setState({ alert: { error: 'Error fetching username!' } });
} else if (Ures) {
this.setState({ inputUsername: Ures });
}
});
}
});
});
onActionSelected(position) {
if (position === 0) { // index of 'Add'
Actions.add();
} else if (position === 1) { // index of 'Done'
Actions.pop();
}
}
function* deleteBasketWatcher() {
while (true) {
// Wait until we get a delete request
const { payload: id } = yield take([BASKET_DELETE_REQUEST])
try {
// Fetch and return it
yield deleteBasket(id)
yield put({type: BASKET_DELETE_SUCCESS, payload: id})
// And leave the scene of action
Actions.pop()
} catch(e) {/* Errors are handled via Redux reducers */}
}
}
componentDidMount() {
const { realm } = this.props;
// Register an action to create a project
Actions.refresh({
rightTitle: " Create",
onRight: () => {
this.toggleModal();
}
});
// Get a result containing all projects
const projects = realm
.objects("Project")
.filtered("owner == $0", this.props.user.identity)
.sorted("timestamp", true);
// When the list of projects change, React won't know about it because the Result object itself did not change.
projects.addListener(() => {
// Bump a data version counter that we'll pass to components that should update when the projects change.
this.setState({ dataVersion: this.state.dataVersion + 1 });
checkFirebaseAuth(accessTokenData).then((user) => {
if (user){
Actions.home({type: ActionConst.RESET})
}else{ // user needs to login to get a Facebook auth token
Actions.login({type: ActionConst.RESET})
}
})
})