Improve reliability of screen titles

This commit is contained in:
Paul Frazee 2022-11-17 16:01:29 -06:00
parent b2160ae159
commit a3bca154c4
16 changed files with 60 additions and 37 deletions

View file

@ -7,7 +7,7 @@ import {useStores} from '../../state'
import {NotificationsViewModel} from '../../state/models/notifications-view'
import {ScreenParams} from '../routes'
export const Notifications = ({visible}: ScreenParams) => {
export const Notifications = ({navIdx, visible}: ScreenParams) => {
const [hasSetup, setHasSetup] = useState<boolean>(false)
const [notesView, setNotesView] = useState<
NotificationsViewModel | undefined
@ -24,7 +24,7 @@ export const Notifications = ({visible}: ScreenParams) => {
console.log('Updating notifications feed')
notesView?.update()
} else {
store.nav.setTitle('Notifications')
store.nav.setTitle(navIdx, 'Notifications')
const newNotesView = new NotificationsViewModel(store, {})
setNotesView(newNotesView)
newNotesView.setup().then(() => {