Skip to content

Commit

Permalink
Only access normalized config in next cms adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed Nov 19, 2024
1 parent f0fb60b commit 6d05691
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/adapter/next/cms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ export interface PreviewProps {
export class NextCMS<
Definition extends Config = Config
> extends CMS<Definition> {
constructor(config: Definition, public baseUrl?: string) {
constructor(rawConfig: Definition, public baseUrl?: string) {
let lastSync = 0
const init = PLazy.from(async () => {
if (process.env.NEXT_RUNTIME === 'edge') throw 'assert'
const {generatedStore} = await import(
'alinea/backend/store/GeneratedStore'
)
const store = await generatedStore
const db = new Database(config, store)
const db = new Database(this.config, store)
const previews = createPreviewParser(db)
return {db, previews}
})
super(config, async () => {
const context = await requestContext(config)
super(rawConfig, async () => {
const context = await requestContext(this.config)
const client = new Client({
config: this.config,
url: context.handlerUrl.href,
Expand Down

0 comments on commit 6d05691

Please sign in to comment.