feat: cleanup
This commit is contained in:
@@ -240,7 +240,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Refresh recording data immediately
|
|
||||||
await refreshRecordingData();
|
await refreshRecordingData();
|
||||||
|
|
||||||
notify("success", t("integration_settings.airtable.notifications.base_selected"));
|
notify("success", t("integration_settings.airtable.notifications.base_selected"));
|
||||||
@@ -292,12 +291,10 @@ export const IntegrationSettingsModal = ({
|
|||||||
{ withCredentials: true }
|
{ withCredentials: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Clear UI state
|
|
||||||
setAirtableBases([]);
|
setAirtableBases([]);
|
||||||
setAirtableTables([]);
|
setAirtableTables([]);
|
||||||
setSettings({ ...settings, airtableBaseId: "", airtableBaseName: "", airtableTableName:"", airtableTableId: "" });
|
setSettings({ ...settings, airtableBaseId: "", airtableBaseName: "", airtableTableName:"", airtableTableId: "" });
|
||||||
|
|
||||||
// Refresh recording data
|
|
||||||
await refreshRecordingData();
|
await refreshRecordingData();
|
||||||
|
|
||||||
notify("success", t("integration_settings.airtable.notifications.integration_removed"));
|
notify("success", t("integration_settings.airtable.notifications.integration_removed"));
|
||||||
@@ -311,7 +308,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle OAuth callback for Airtable
|
|
||||||
const handleAirtableOAuthCallback = async () => {
|
const handleAirtableOAuthCallback = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`${apiUrl}/auth/airtable/callback`);
|
const response = await axios.get(`${apiUrl}/auth/airtable/callback`);
|
||||||
@@ -323,20 +319,16 @@ export const IntegrationSettingsModal = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fetch recording info on component mount and when recordingId changes
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchRecordingInfo = async () => {
|
const fetchRecordingInfo = async () => {
|
||||||
if (!recordingId) return;
|
if (!recordingId) return;
|
||||||
|
|
||||||
console.log("Fetching recording info for ID:", recordingId);
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
const recording = await getStoredRecording(recordingId);
|
const recording = await getStoredRecording(recordingId);
|
||||||
if (recording) {
|
if (recording) {
|
||||||
console.log("Recording fetched:", recording);
|
|
||||||
setRecording(recording);
|
setRecording(recording);
|
||||||
|
|
||||||
// Update settings based on existing integrations
|
|
||||||
if (recording.google_sheet_id) {
|
if (recording.google_sheet_id) {
|
||||||
setSettings(prev => ({ ...prev, integrationType: "googleSheets" }));
|
setSettings(prev => ({ ...prev, integrationType: "googleSheets" }));
|
||||||
} else if (recording.airtable_base_id) {
|
} else if (recording.airtable_base_id) {
|
||||||
@@ -357,7 +349,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
fetchRecordingInfo();
|
fetchRecordingInfo();
|
||||||
}, [recordingId, preSelectedIntegrationType]);
|
}, [recordingId, preSelectedIntegrationType]);
|
||||||
|
|
||||||
// Handle Airtable authentication cookies
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const status = getCookie("airtable_auth_status");
|
const status = getCookie("airtable_auth_status");
|
||||||
const message = getCookie("airtable_auth_message");
|
const message = getCookie("airtable_auth_message");
|
||||||
@@ -394,7 +385,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
{t("integration_settings.title_select_integration")}
|
{t("integration_settings.title_select_integration")}
|
||||||
</Typography>
|
</Typography>
|
||||||
<div style={{ display: "flex", gap: "20px" }}>
|
<div style={{ display: "flex", gap: "20px" }}>
|
||||||
{/* Google Sheets Button */}
|
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -407,7 +397,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
Google Sheets
|
Google Sheets
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/* Airtable Button */}
|
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -434,7 +423,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
marginLeft: "65px",
|
marginLeft: "65px",
|
||||||
}}>
|
}}>
|
||||||
|
|
||||||
{/* Google Sheets Integration */}
|
|
||||||
{settings.integrationType === "googleSheets" && (
|
{settings.integrationType === "googleSheets" && (
|
||||||
<>
|
<>
|
||||||
<Typography variant="h6">
|
<Typography variant="h6">
|
||||||
@@ -535,7 +523,6 @@ export const IntegrationSettingsModal = ({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Airtable Integration */}
|
|
||||||
{settings.integrationType === "airtable" && (
|
{settings.integrationType === "airtable" && (
|
||||||
<>
|
<>
|
||||||
<Typography variant="h6">
|
<Typography variant="h6">
|
||||||
|
|||||||
Reference in New Issue
Block a user