web: add firebase push token registration and sync
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user