Compare commits
No commits in common. "9ee46d206732400628bc8887cc6741e5588166cb" and "2bf929bb492ac94cfc7b41d13f48d300685f6bde" have entirely different histories.
9ee46d2067
...
2bf929bb49
@ -344,8 +344,7 @@ body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-modal-mask,
|
.ant-modal-mask {
|
||||||
.ant-drawer-mask {
|
|
||||||
backdrop-filter: blur(3px);
|
backdrop-filter: blur(3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -968,8 +967,7 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.electron-body .ant-modal-wrap,
|
.electron-body .ant-modal-wrap,
|
||||||
.electron-body .ant-modal-mask,
|
.electron-body .ant-modal-mask {
|
||||||
.electron-body .ant-drawer {
|
|
||||||
top: 41px;
|
top: 41px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,14 +25,12 @@ const { Text } = Typography
|
|||||||
const NotesPanel = ({ _id, type }) => {
|
const NotesPanel = ({ _id, type }) => {
|
||||||
const [newNoteOpen, setNewNoteOpen] = useState(false)
|
const [newNoteOpen, setNewNoteOpen] = useState(false)
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
const [initialized, setInitialized] = useState(false)
|
||||||
const [error, setError] = useState(null)
|
const [error, setError] = useState(null)
|
||||||
const [notes, setNotes] = useState(null)
|
const [notes, setNotes] = useState(null)
|
||||||
const [expandedNotes, setExpandedNotes] = useState({})
|
const [expandedNotes, setExpandedNotes] = useState({})
|
||||||
const subscribeToObjectTypeUpdatesRef = useRef(null)
|
const subscribeToObjectTypeUpdatesRef = useRef(null)
|
||||||
|
|
||||||
const notesIdRef = useRef(null)
|
|
||||||
const notesTypeRef = useRef(null)
|
|
||||||
|
|
||||||
const { token } = useContext(AuthContext)
|
const { token } = useContext(AuthContext)
|
||||||
const { fetchNotes, connected, subscribeToObjectTypeUpdates } =
|
const { fetchNotes, connected, subscribeToObjectTypeUpdates } =
|
||||||
useContext(ApiServerContext)
|
useContext(ApiServerContext)
|
||||||
@ -52,7 +50,6 @@ const NotesPanel = ({ _id, type }) => {
|
|||||||
|
|
||||||
const generateNotes = useCallback(
|
const generateNotes = useCallback(
|
||||||
async (id) => {
|
async (id) => {
|
||||||
setLoading(true)
|
|
||||||
const notesData = await fetchData(id)
|
const notesData = await fetchData(id)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
||||||
@ -111,16 +108,11 @@ const NotesPanel = ({ _id, type }) => {
|
|||||||
}, [_id, subscribeToObjectTypeUpdates, connected, handleReloadData])
|
}, [_id, subscribeToObjectTypeUpdates, connected, handleReloadData])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (connected == true && token != null && !initialized) {
|
||||||
connected == true &&
|
|
||||||
token != null &&
|
|
||||||
(_id != notesIdRef.current || type != notesTypeRef.current)
|
|
||||||
) {
|
|
||||||
handleReloadData()
|
handleReloadData()
|
||||||
notesIdRef.current = _id
|
setInitialized(true)
|
||||||
notesTypeRef.current = type
|
|
||||||
}
|
}
|
||||||
}, [token, handleReloadData, connected, _id, type])
|
}, [token, handleReloadData, initialized, connected])
|
||||||
|
|
||||||
const actionItems = {
|
const actionItems = {
|
||||||
items: [
|
items: [
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import { ApiServerContext } from './ApiServerContext'
|
|||||||
import NotificationCenter from '../common/NotificationCenter'
|
import NotificationCenter from '../common/NotificationCenter'
|
||||||
import Notification from '../common/Notification'
|
import Notification from '../common/Notification'
|
||||||
import { useMediaQuery } from 'react-responsive'
|
import { useMediaQuery } from 'react-responsive'
|
||||||
|
import { ElectronContext } from './ElectronContext'
|
||||||
|
|
||||||
const NotificationContext = createContext()
|
const NotificationContext = createContext()
|
||||||
|
|
||||||
@ -35,6 +36,8 @@ const NotificationProvider = ({ children }) => {
|
|||||||
const [notifications, setNotifications] = useState([])
|
const [notifications, setNotifications] = useState([])
|
||||||
const [notificationsLoading, setNotificationsLoading] = useState(false)
|
const [notificationsLoading, setNotificationsLoading] = useState(false)
|
||||||
|
|
||||||
|
const { isElectron } = useContext(ElectronContext)
|
||||||
|
|
||||||
const isMobile = useMediaQuery({ maxWidth: 768 })
|
const isMobile = useMediaQuery({ maxWidth: 768 })
|
||||||
|
|
||||||
const fetchNotifications = useCallback(async () => {
|
const fetchNotifications = useCallback(async () => {
|
||||||
@ -180,6 +183,7 @@ const NotificationProvider = ({ children }) => {
|
|||||||
title='Notifications'
|
title='Notifications'
|
||||||
placement='right'
|
placement='right'
|
||||||
width={isMobile ? '100%' : 460}
|
width={isMobile ? '100%' : 460}
|
||||||
|
style={{ marginTop: isElectron ? '40px' : '0px' }}
|
||||||
onClose={() => setNotificationCenterVisible(false)}
|
onClose={() => setNotificationCenterVisible(false)}
|
||||||
open={notificationCenterVisible}
|
open={notificationCenterVisible}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user