diff --git a/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx b/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx index 706c76e..aae9504 100644 --- a/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx +++ b/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx @@ -48,7 +48,7 @@ const SignersList: React.FC<{ signers: Signer[] }> = ({ signers }) => { {signers.map((signer) => (
Send
++ {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ? "Save" : "Send"} +
{recipient.status}
handleNavigateToSign(recipient.id)}
className='text-white rounded-sm bg-[var(--primary)] px-3 py-1 font-semibold'>
diff --git a/src/store/slices/documentSlice.ts b/src/store/slices/documentSlice.ts
index cd011c3..06bfa79 100644
--- a/src/store/slices/documentSlice.ts
+++ b/src/store/slices/documentSlice.ts
@@ -213,7 +213,13 @@ export const fetchDocuments = createAsyncThunk<
`/api/accounts/${accountId}/${toggle}/${transactionId}/documents?include_images=true`
);
- return response.data as Document[];
+ const data = response.data as Document[];
+
+ if (data.length === 0 && window.location.pathname.includes('/process-step-two')) {
+ window.location.href = window.location.href.replace("process-step-two", "process-step-one") // ✅ navigate using window
+ }
+
+ return data;
} catch (error: any) {
return rejectWithValue(error.response?.data || 'Failed to fetch documents');
}
diff --git a/src/store/slices/selectedRecipientsSlice.tsx b/src/store/slices/selectedRecipientsSlice.tsx
index 217b7d5..f7a3d02 100644
--- a/src/store/slices/selectedRecipientsSlice.tsx
+++ b/src/store/slices/selectedRecipientsSlice.tsx
@@ -463,7 +463,13 @@ export const fetchRecipients = createAsyncThunk<
const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`;
const response = await api.get(basePath);
- return response.data as Recipient[];
+ const data = response.data as Recipient[];
+
+ if (data.length === 0 && window.location.pathname.includes('/process-step-two')) {
+ window.location.href = window.location.href.replace("process-step-two", "process-step-one") // ✅ navigate using window
+ }
+
+ return data as Recipient[];
} catch (err: any) {
return rejectWithValue(err.response?.data || "Failed to fetch recipients");
}
@@ -475,17 +481,20 @@ const selectedRecipientsSlice = createSlice({
initialState,
reducers: {
addRecipient: (state, action: PayloadAction