mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
fix: update Gmail provider constant and adjust metadata synchronization logic
- Changed the constant for the Google provider from 'google' to 'gmail' for clarity. - Commented out the email metadata synchronization logic in `syncGmailMetadataToBackend` to prevent potential issues with undefined email states.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import { emitViaRustSocket } from '../../utils/tauriSocket';
|
||||
|
||||
const INTEGRATION_METADATA_SYNC_EVENT = 'integration:metadata-sync';
|
||||
const PROVIDER_GOOGLE = 'google';
|
||||
const PROVIDER_GOOGLE = 'gmail';
|
||||
|
||||
/** Gmail profile shape from skill state (snake_case). */
|
||||
interface GmailProfileLike {
|
||||
@@ -48,9 +48,9 @@ export function syncGmailMetadataToBackend(gmailState: GmailStateForSync | undef
|
||||
history_id: profile.history_id,
|
||||
};
|
||||
|
||||
if (Array.isArray(gmailState.emails) && gmailState.emails.length > 0) {
|
||||
metadata.emails = gmailState.emails as GmailEmailSummaryLike[];
|
||||
}
|
||||
// if (Array.isArray(gmailState.emails) && gmailState.emails.length > 0) {
|
||||
// metadata.emails = gmailState.emails as GmailEmailSummaryLike[];
|
||||
// }
|
||||
|
||||
const payload = {
|
||||
requestId: crypto.randomUUID(),
|
||||
|
||||
@@ -93,7 +93,7 @@ function syncGmailStateToSlice(
|
||||
Array.isArray(gmailState.emails) ? (gmailState.emails as GmailEmailSummary[]) : []
|
||||
)
|
||||
);
|
||||
syncGmailMetadataToBackend(gmailState as GmailStateForSync);
|
||||
syncGmailMetadataToBackend(gmailState.profile as GmailStateForSync);
|
||||
}
|
||||
|
||||
export default function SkillProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
Reference in New Issue
Block a user