Skip to content

Commit

Permalink
refactor: update usage of @ayco/astro-resume
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoayco committed Jul 16, 2023
1 parent a8b5513 commit 2e574e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@astrojs/netlify": "^2.2.2",
"@ayco/astro-resume": "^0.0.9",
"@ayco/astro-resume": "^0.1.2",
"@extractus/article-extractor": "^7.2.15",
"astro-iconify": "^1.2.0",
"sass": "^1.62.1"
Expand Down
8 changes: 4 additions & 4 deletions src/components/Library.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Resumable from '@ayco/astro-resume';
import Serialize from '@ayco/astro-resume';
export interface Props {
routerOutlet: string,
skipSave?: boolean
Expand All @@ -12,10 +12,10 @@ const {routerOutlet, skipSave = false} = Astro.props;
<ul id="post-list"></ul>
</div>

<Resumable id="preferences" data={{routerOutlet, skipSave}} />
<Serialize id="preferences" data={{routerOutlet, skipSave}} />

<script>
import {resume} from '@ayco/astro-resume';
import {deserialize} from '@ayco/astro-resume';
import {Props} from './Library.astro';
import { getPostCard, renderPost } from '../utils/library'
const cache = await caches.open('cozy-reader');
Expand All @@ -26,7 +26,7 @@ const {routerOutlet, skipSave = false} = Astro.props;
url = new URL(`${url.origin}/?url=${urlParam}`);
}
const response = await cache.match(url);
const {routerOutlet, skipSave} = resume<Props>('preferences');
const {routerOutlet, skipSave} = deserialize<Props>('preferences');
const includesAppURL = urlParam?.includes(window.location.origin)

if (!response && !skipSave && !includesAppURL) {
Expand Down

0 comments on commit 2e574e2

Please sign in to comment.