Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const newInternalTxs = this.handleInternalTransactions(newStatus.txHash);
Engine.context.TransactionController.update({ internalTransactions: newInternalTxs });
this.setState({ withdrawalPending: false, withdrawalPendingValue: undefined });
}
}
}
if (newStatus.type !== status.type) {
newStatus.reset = true;
if (newStatus.type && newStatus.type !== 'DEPOSIT_PENDING') {
const notification_type = newStatus.type
.toLowerCase()
.split('_')
.reverse()
.join('_');
hideMessage();
setTimeout(() => {
TransactionsNotificationManager.showInstantPaymentNotification(notification_type);
}, 300);
}
}
this.setState({ status: newStatus });
}
showSimpleMessage(type = "default", props = {}) {
const message = {
message: "Some message title",
description: "Lorem ipsum dolar sit amet",
icon: { icon: "auto", position: "left" },
type,
...props,
};
showMessage(message);
}
messageWithPosition(position = "top", hasDescription = true, extra = {}) {
messageWithPosition(position = "top", hasDescription = true, extra = {}) {
let message = {
message: "Some message title",
type: "info",
position,
...extra,
};
if (hasDescription) {
message = { ...message, description: "Lorem ipsum dolar sit amet" };
} else {
message = { ...message, floating: true };
}
showMessage(message);
}
render() {
async updateConfig() {
try {
const config = {
...this.props.config,
notificationsEnabled: this.state.notificationsEnabled,
notificationsPreviews: this.state.notificationsPreviews,
}
await this.props.context.mutations.configUpdate(config)
} catch (e) {
showMessage({
message: String(e),
type: 'danger',
icon: 'danger',
position: 'top',
})
this.setState({
notificationsEnabled: this.getCurrentConfig().notificationsEnabled,
notificationsPreviews: this.getCurrentConfig().notificationsPreviews,
})
}
}
async updateConfig (field) {
try {
const config = {
...this.props.config,
[field]: this.state.config[field],
}
await this.props.context.node.service.configUpdate(config)
} catch (e) {
showMessage({
message: String(e),
type: 'danger',
icon: 'danger',
position: 'top',
})
}
}
}
const id = (data && data.message && data.message.transaction && data.message.transaction.id) || null;
const extraData = { action: 'tx', id };
if (Platform.OS === 'android') {
pushData.tag = JSON.stringify(extraData);
} else {
pushData.userInfo = extraData;
}
PushNotification.localNotification(pushData);
if (id) {
this._transactionToView.push(id);
}
} else {
showMessage(data);
}
}
componentDidMount() {
const messageProps = get(this.props, 'navigation.state.params.messageProps');
if (messageProps) {
const { title, body, type } = messageProps;
showMessage({
message: title,
description: body,
type,
});
}
}
type: "success",
hideStatusBar: true,
})
}
/>
hideMessage()} />
label="Hide Status (iOS)"
onPress={() =>
showMessage({
message: "Message that hide your status bar",
description: "Cool, uhm?",
type: "success",
hideStatusBar: true,
})
}
/>
hideMessage()} />