Cleanup for error notifications
This commit is contained in:
@@ -111,7 +111,8 @@
|
|||||||
'/auth/google',
|
'/auth/google',
|
||||||
'google-auth',
|
'google-auth',
|
||||||
'width=500,height=600,scrollbars=yes,resizable=yes,left=' +
|
'width=500,height=600,scrollbars=yes,resizable=yes,left=' +
|
||||||
Math.round(window.screen.width / 2 - 250) + ',top=' +
|
Math.round(window.screen.width / 2 - 250) +
|
||||||
|
',top=' +
|
||||||
Math.round(window.screen.height / 2 - 300)
|
Math.round(window.screen.height / 2 - 300)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -190,7 +191,6 @@
|
|||||||
cleanUp();
|
cleanUp();
|
||||||
}
|
}
|
||||||
}, 60 * 1000); // Reduced from 3min to 1min
|
}, 60 * 1000); // Reduced from 3min to 1min
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error connecting to Google:', error);
|
console.error('Error connecting to Google:', error);
|
||||||
authData.error = 'Failed to connect to Google';
|
authData.error = 'Failed to connect to Google';
|
||||||
@@ -332,7 +332,7 @@
|
|||||||
const response = await fetch('/private/api/google/sheets/recent', {
|
const response = await fetch('/private/api/google/sheets/recent', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${localStorage.getItem('google_refresh_token')}`
|
Authorization: `Bearer ${localStorage.getItem('google_refresh_token')}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -363,7 +363,7 @@
|
|||||||
const response = await fetch(`/private/api/google/sheets/${sheet.id}/data`, {
|
const response = await fetch(`/private/api/google/sheets/${sheet.id}/data`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${localStorage.getItem('google_refresh_token')}`
|
Authorization: `Bearer ${localStorage.getItem('google_refresh_token')}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -427,15 +427,13 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="max-w-4xl mx-auto p-6">
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<StepNavigator {currentStep} {totalSteps} />
|
<StepNavigator {currentStep} {totalSteps} />
|
||||||
|
|
||||||
<!-- Step Content -->
|
<!-- Step Content -->
|
||||||
<div class="rounded-lg border border-gray-300 bg-white p-6 mb-4">
|
<div class="mb-4 rounded border border-gray-300 bg-white p-6">
|
||||||
{#if currentStep === 0}
|
{#if currentStep === 0}
|
||||||
<GoogleAuthStep
|
<GoogleAuthStep
|
||||||
bind:errors
|
|
||||||
onSuccess={(token) => {
|
onSuccess={(token) => {
|
||||||
authData.error = null;
|
authData.error = null;
|
||||||
authData.token = token;
|
authData.token = token;
|
||||||
@@ -450,15 +448,14 @@
|
|||||||
{:else if currentStep === 1}
|
{:else if currentStep === 1}
|
||||||
<EventDetailsStep bind:eventData />
|
<EventDetailsStep bind:eventData />
|
||||||
{:else if currentStep === 2}
|
{:else if currentStep === 2}
|
||||||
<GoogleSheetsStep bind:sheetsData bind:errors {loadRecentSheets} {selectSheet} {toggleSheetList} />
|
<GoogleSheetsStep
|
||||||
|
bind:sheetsData
|
||||||
|
{loadRecentSheets}
|
||||||
|
{selectSheet}
|
||||||
|
{toggleSheetList}
|
||||||
|
/>
|
||||||
{:else if currentStep === 3}
|
{:else if currentStep === 3}
|
||||||
<EmailSettingsStep bind:emailData bind:errors />
|
<EmailSettingsStep bind:emailData />
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if errors.submit}
|
|
||||||
<div class="mt-4 p-3 bg-red-50 border border-red-200 rounded">
|
|
||||||
<p class="text-sm text-red-600">{errors.submit}</p>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -472,4 +469,3 @@
|
|||||||
{nextStep}
|
{nextStep}
|
||||||
{createEvent}
|
{createEvent}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@
|
|||||||
Detected templates: {bodyTemplatesDetected.map((v) => v.name).join(', ')}
|
Detected templates: {bodyTemplatesDetected.map((v) => v.name).join(', ')}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- Errors now shown as toast notifications -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -21,7 +21,5 @@
|
|||||||
onSuccess={onSuccess}
|
onSuccess={onSuccess}
|
||||||
onError={onError}
|
onError={onError}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Error messages are now shown as toast notifications -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -255,8 +255,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- Error messages are now shown as toast notifications -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if sheetsData.selectedSheet && sheetsData.sheetData.length > 0}
|
{#if sheetsData.selectedSheet && sheetsData.sheetData.length > 0}
|
||||||
@@ -370,8 +368,6 @@
|
|||||||
<div class="text-gray-600">Loading sheet data...</div>
|
<div class="text-gray-600">Loading sheet data...</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- Error messages are now shown as toast notifications -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user