Unverified Commit fe5f03f9 authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub

fix: bug when scan sender not found (#686)

parent cceca67a
Pipeline #105676 failed with stages
in 3 minutes and 9 seconds
......@@ -52,7 +52,7 @@ export default function Scanner({
function showAlertMessage(
title: string,
message: string,
isSuccess?: boolean
isAddNetworkSuccess?: boolean
): void {
const clearByTap = async (): Promise<void> => {
scannerStore.cleanup();
......@@ -61,14 +61,7 @@ export default function Scanner({
setEnableScan(true);
};
setEnableScan(false);
if (isSuccess) {
setAlert(title, message, [
{
onPress: clearByTap,
text: 'Try again'
}
]);
} else {
if (isAddNetworkSuccess) {
setAlert(title, message, [
{
onPress: async (): Promise<void> => {
......@@ -79,6 +72,13 @@ export default function Scanner({
text: 'Done'
}
]);
} else {
setAlert(title, message, [
{
onPress: clearByTap,
text: 'Try again'
}
]);
}
}
......
......@@ -221,7 +221,8 @@ export function useProcessBarCode(
networksContextState.addNetwork(networkParsedData);
return showAlertMessage(
strings.SUCCESS_TITLE,
strings.SUCCESS_ADD_NETWORK + networkParsedData.data.title
strings.SUCCESS_ADD_NETWORK + networkParsedData.data.title,
true
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment