web: add firebase push token registration and sync

This commit is contained in:
Codex
2026-03-09 23:12:40 +03:00
parent b1b54896a7
commit ef28c165e6
8 changed files with 1104 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import { ChatsPage } from "../pages/ChatsPage";
import { useAuthStore } from "../store/authStore";
import { useChatStore } from "../store/chatStore";
import { useUiStore } from "../store/uiStore";
import { ensureWebPushRegistration } from "../utils/firebasePush";
import { applyAppearancePreferences, getAppPreferences } from "../utils/preferences";
const PENDING_INVITE_TOKEN_KEY = "bm_pending_invite_token";
@@ -118,6 +119,13 @@ export function App() {
})();
}, [accessToken, me, joiningInvite, loadChats, setActiveChatId, showToast]);
useEffect(() => {
if (!accessToken || !me) {
return;
}
void ensureWebPushRegistration();
}, [accessToken, me]);
useEffect(() => {
if (!accessToken || !me || joiningInvite) {
return;