fix: electron api

This commit is contained in:
Timothy Jaeryang Baek 2025-01-13 19:53:00 -08:00
parent 15e591f30d
commit ce1712fed1

View File

@ -105,9 +105,12 @@
let isFocused = document.visibilityState !== 'visible';
if (window.electronAPI) {
isFocused = await window.electronAPI.send({
const res = await window.electronAPI.send({
type: 'window:isFocused'
});
if (res) {
isFocused = res.isFocused;
}
}
if ((event.chat_id !== $chatId && !$temporaryChatEnabled) || isFocused) {
@ -155,9 +158,12 @@
let isFocused = document.visibilityState !== 'visible';
if (window.electronAPI) {
isFocused = await window.electronAPI.send({
const res = await window.electronAPI.send({
type: 'window:isFocused'
});
if (res) {
isFocused = res.isFocused;
}
}
if ((!channel || isFocused) && event?.user?.id !== $user?.id) {