fix hugo callback

This commit is contained in:
2025-06-19 14:48:54 +09:00
parent 293421b7a5
commit 5fac689f98
15 changed files with 832 additions and 138 deletions

View File

@ -253,6 +253,24 @@ function setupAskAIEventListeners() {
handleAIResponse(event.detail);
});
// Listen for OAuth callback completion from iframe
window.addEventListener('message', function(event) {
if (event.data.type === 'oauth_success') {
console.log('Received OAuth success message:', event.data);
// Close any OAuth popups/iframes
const oauthFrame = document.getElementById('oauth-frame');
if (oauthFrame) {
oauthFrame.remove();
}
// Reload the page to refresh OAuth app state
setTimeout(() => {
window.location.reload();
}, 500);
}
});
// Track IME composition state
let isComposing = false;
const aiQuestionInput = document.getElementById('aiQuestion');