@betterinternship/components 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +9 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -2
package/dist/index.esm.js
CHANGED
|
@@ -3663,11 +3663,17 @@ function useClientProcessBase({ processId, processName, processCallbackUrl, base
|
|
|
3663
3663
|
throw new Error("No processId");
|
|
3664
3664
|
if (!processName)
|
|
3665
3665
|
throw new Error("No processName");
|
|
3666
|
+
// ! remove
|
|
3667
|
+
console.log('[DEBUG] Found process here: ', processId, processName);
|
|
3666
3668
|
const statusResponse = await processStatusChecker(processId);
|
|
3669
|
+
// ! remove
|
|
3670
|
+
console.log('[DEBUG] Status response: ', statusResponse);
|
|
3667
3671
|
// Handled! Return the proper response too
|
|
3668
3672
|
if (statusResponse.status === "handled") {
|
|
3669
3673
|
const response = await processCallbackFetcher(processId, processName, processCallbackUrl);
|
|
3670
3674
|
setStatus("handled");
|
|
3675
|
+
// ! remove
|
|
3676
|
+
console.log('[DEBUG] Callback response: ', response);
|
|
3671
3677
|
return response;
|
|
3672
3678
|
}
|
|
3673
3679
|
// Pending or failed
|
|
@@ -3718,17 +3724,20 @@ function useClientProcess({ caller, loadingMessage, successMessage, failureMessa
|
|
|
3718
3724
|
return;
|
|
3719
3725
|
// Update toast to show current state
|
|
3720
3726
|
if (clientProcess.status === 'pending') {
|
|
3727
|
+
console.log(response.processName, loadingMessage ?? "Loading...");
|
|
3721
3728
|
toast.loading(loadingMessage ?? "Loading...", {
|
|
3722
3729
|
id: response.processId,
|
|
3723
3730
|
duration: Infinity,
|
|
3724
3731
|
});
|
|
3725
3732
|
}
|
|
3726
3733
|
else if (clientProcess.status === 'failed') {
|
|
3734
|
+
console.error(response.processName, failureMessage ?? "Something went wrong.");
|
|
3727
3735
|
toast.error(failureMessage ?? "Something went wrong.", {
|
|
3728
3736
|
id: response.processId
|
|
3729
3737
|
});
|
|
3730
3738
|
}
|
|
3731
3739
|
else if (clientProcess.status === 'handled') {
|
|
3740
|
+
console.warn(response.processName, successMessage ?? "Success!");
|
|
3732
3741
|
toast.success(successMessage ?? "Success!", {
|
|
3733
3742
|
id: response.processId
|
|
3734
3743
|
});
|