Skip to content
Snippets Groups Projects

Add installationUrl to entry store

Merged David Sikter requested to merge 828-add-installation-url-to-entry-store into develop
2 unresolved threads
3 files
+ 37
33
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -19,6 +19,7 @@
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'
import PropTypes from 'prop-types'
import { useDataStore } from '../DataStore'
import { apiBase } from '../../config'
const entryPageContext = React.createContext()
@@ -28,14 +29,14 @@ export const useEntryPageContext = () => {
const EntryPageContext = React.memo(function EntryContext({entryId, children}) {
const dataStore = useDataStore()
const [entryStoreObj, setEntryStoreObj] = useState(dataStore.getEntry(entryId))
const [entryStoreObj, setEntryStoreObj] = useState(dataStore.getEntry(apiBase, entryId))
const onEntryStoreUpdated = useCallback((oldStoreObj, newStoreObj) => {
setEntryStoreObj(newStoreObj)
}, [setEntryStoreObj])
useEffect(() => {
return dataStore.subscribeToEntry(entryId, onEntryStoreUpdated, true, true, true)
return dataStore.subscribeToEntry(apiBase, entryId, onEntryStoreUpdated, true, true, true)
}, [dataStore, entryId, onEntryStoreUpdated])
const contextValue = useMemo(() => { return entryStoreObj }, [entryStoreObj])
Loading