Skip to content

Commit

Permalink
Remove extra pagekey assign
Browse files Browse the repository at this point in the history
  • Loading branch information
jho406 committed Dec 12, 2024
1 parent 66bb600 commit e63566a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion superglue/lib/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function handleSaveResponse(
state = { ...state }

let nextPage: Page = {
pageKey,
// pageKey,
...page,
savedAt: Date.now(),
}
Expand Down
2 changes: 1 addition & 1 deletion superglue/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export type VisitResponse<T = JSONMappable> = {
*/
export type Page<T = JSONMappable> = VisitResponse<T> & {
savedAt: number
pageKey: PageKey
// pageKey: PageKey
}

/**
Expand Down
4 changes: 0 additions & 4 deletions superglue/spec/features/navigation.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ describe('start', () => {
},
pages: {
'/home?some=123': {
pageKey: '/home?some=123',
fragments: [],
data: {
heading: 'this is page 1',
Expand Down Expand Up @@ -173,7 +172,6 @@ describe('navigation', () => {
csrfToken: 'token',
assets: ['application-123.js', 'application-123.js'],
componentIdentifier: 'about',
pageKey: '/about',
fragments: [],
savedAt: expect.any(Number),
}
Expand Down Expand Up @@ -240,7 +238,6 @@ describe('navigation', () => {
csrfToken: 'token',
assets: ['application-123.js', 'application-123.js'],
componentIdentifier: 'about',
pageKey: '/about',
fragments: [],
savedAt: expect.any(Number),
}
Expand Down Expand Up @@ -574,7 +571,6 @@ describe('navigation', () => {
csrfToken: 'token',
assets: ['application-123.js', 'application-123.js'],
componentIdentifier: 'about',
pageKey: '/about',
fragments: [],
savedAt: expect.any(Number),
}
Expand Down
7 changes: 0 additions & 7 deletions superglue/spec/lib/reducers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ describe('reducers', () => {
data: {},
csrfToken: 'token',
assets: ['application-123.js'],
pageKey: '/foo',
fragments: [],
savedAt: expect.any(Number),
})
Expand Down Expand Up @@ -436,7 +435,6 @@ describe('reducers', () => {
},
},
},
pageKey: '/foo',
defers: [
{ url: '/foo?props_at=data.foo.bar', path: 'data.foo.bar' },
],
Expand Down Expand Up @@ -472,7 +470,6 @@ describe('reducers', () => {
},
},
},
pageKey: '/foo',
defers: [{ url: '/foo?props_at=data.foo.bar', path: 'data.foo.bar' }],
fragments: [],
savedAt: expect.any(Number),
Expand All @@ -489,7 +486,6 @@ describe('reducers', () => {
},
},
},
pageKey: '/bar',
defers: [
{ url: '/bar?props_at=data.foo.bar', path: 'data.foo.bar' },
],
Expand Down Expand Up @@ -527,7 +523,6 @@ describe('reducers', () => {
},
baz: 'received',
},
pageKey: '/bar',
defers: [{ url: '/bar?props_at=data.foo.bar', path: 'data.foo.bar' }],
fragments: [{ type: 'info', partial: 'info', path: 'data.foo.bar' }],
savedAt: expect.any(Number),
Expand All @@ -544,7 +539,6 @@ describe('reducers', () => {
},
},
},
pageKey: '/bar',
defers: [
{ url: '/bar?props_at=data.foo.bar', path: 'data.foo.bar' },
],
Expand Down Expand Up @@ -576,7 +570,6 @@ describe('reducers', () => {
bar: {},
},
},
pageKey: '/foo',
defers: [{ url: '/foo?props_at=data.foo.bar', path: 'data.foo.bar' }],
fragments: [{ type: 'info', partial: 'info', path: 'data.foo.bar' }],
savedAt: expect.any(Number),
Expand Down

0 comments on commit e63566a

Please sign in to comment.