Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeout(function() {
Toast.hide(toast);
}, 3000);
setTimeout(function() {
Toast.hide(toast);
}, 3000);
}
export const toastShort = (content) => {
if (toast !== undefined) {
Toast.hide(toast);
}
toast = Toast.show(content.toString(), {
duration: Toast.durations.SHORT,
position: Platform.OS === 'android' ? Toast.positions.BOTTOM : Toast.positions.CENTER,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0
});
};
export function hideToast(toast) {
Toast.hide(toast)
}
setTimeout(function () {
Toast.hide(toast);
}, 2000);
} else {
export const toastLong = (content) => {
if (toast !== undefined) {
Toast.hide(toast);
}
toast = Toast.show(content.toString(), {
duration: Toast.durations.LONG,
position: Platform.OS === 'android' ? Toast.positions.BOTTOM : Toast.positions.CENTER,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0
});
};
setTimeout(() => {
toast && Toast.hide(toast);
toast = null;
}, 100);
}
setTimeout(function() {
Toast.hide(toast);
}, 3000);
}
setTimeout(function () {
Toast.hide(toast);
}, 2000);
} else {
export const toastLong = (content) => {
if (toast !== undefined) {
Toast.hide(toast);
}
toast = Toast.show(content.toString(), {
duration: Toast.durations.LONG,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0
});
};