Skip to content

Commit 09fcf2d

Browse files
committed
fix bugs
1 parent eb47af6 commit 09fcf2d

File tree

9 files changed

+13
-12
lines changed

9 files changed

+13
-12
lines changed

apps/web/src/app/(dynamicPages)/entry/[category]/[author]/[permlink]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { prefetchQuery } from "@/core/react-query";
2-
import { getPostQueryOptions, getAccountFullQueryOptions, getDeletedEntryQueryOptions } from "@ecency/sdk";
2+
import { getAccountFullQueryOptions, getDeletedEntryQueryOptions } from "@ecency/sdk";
3+
import { EcencyEntriesCacheManagement } from "@/core/caches";
34
import { EntryPageContentClient } from "@/app/(dynamicPages)/entry/[category]/[author]/[permlink]/_components/entry-page-content-client";
45
import { EntryPageContentSSR } from "@/app/(dynamicPages)/entry/[category]/[author]/[permlink]/_components/entry-page-content-ssr";
56
import { getQueryClient } from "@/core/react-query";
@@ -41,7 +42,7 @@ export default async function EntryPage({ params, searchParams }: Props) {
4142
const isRawContent = sParams.raw !== undefined;
4243

4344
const author = username.replace("%40", "");
44-
const entry = await prefetchQuery(getPostQueryOptions(author, permlink));
45+
const entry = await prefetchQuery(EcencyEntriesCacheManagement.getEntryQueryByPath(author, permlink));
4546

4647
if (
4748
permlink.startsWith("wave-") ||

apps/web/src/app/(dynamicPages)/entry/_helpers/generate-entry-metadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Metadata } from "next";
55
import { getContent } from "@/api/hive";
66
import { getProfiles, Profile } from "@/api/bridge";
77
import { prefetchQuery } from "@/core/react-query";
8-
import { getPostQueryOptions } from "@ecency/sdk";
8+
import { EcencyEntriesCacheManagement } from "@/core/caches";
99
import { getServerAppBase } from "@/utils/server-app-base";
1010
import { FullAccount } from "@/entities";
1111

@@ -40,7 +40,7 @@ export async function generateEntryMetadata(
4040
}
4141
try {
4242
const cleanAuthor = username.replace("%40", "");
43-
let entry = await prefetchQuery(getPostQueryOptions(cleanAuthor, cleanPermlink));
43+
let entry = await prefetchQuery(EcencyEntriesCacheManagement.getEntryQueryByPath(cleanAuthor, cleanPermlink));
4444

4545
if (!entry || !entry.body || !entry.created) {
4646
console.warn("generateEntryMetadata: incomplete, trying fallback getContent", {

packages/sdk/dist/browser/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk/dist/browser/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk/dist/node/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3693,7 +3693,7 @@ function buildQuery(entry, retry = 3) {
36933693
q += ` -dporn type:post`;
36943694
let tags;
36953695
if (json_metadata && json_metadata.tags && Array.isArray(json_metadata.tags)) {
3696-
tags = json_metadata.tags.filter((tag) => tag && tag !== "").filter((tag) => !tag.startsWith("hive-")).filter((_tag, ind) => ind < +retry).join(",");
3696+
tags = json_metadata.tags.filter((tag) => tag && tag !== "" && typeof tag === "string").filter((tag) => !tag.startsWith("hive-")).filter((_tag, ind) => ind < +retry).join(",");
36973697
}
36983698
if (tags && tags.length > 0) {
36993699
q += ` tag:${tags}`;

packages/sdk/dist/node/index.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk/dist/node/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3668,7 +3668,7 @@ function buildQuery(entry, retry = 3) {
36683668
q += ` -dporn type:post`;
36693669
let tags;
36703670
if (json_metadata && json_metadata.tags && Array.isArray(json_metadata.tags)) {
3671-
tags = json_metadata.tags.filter((tag) => tag && tag !== "").filter((tag) => !tag.startsWith("hive-")).filter((_tag, ind) => ind < +retry).join(",");
3671+
tags = json_metadata.tags.filter((tag) => tag && tag !== "" && typeof tag === "string").filter((tag) => !tag.startsWith("hive-")).filter((_tag, ind) => ind < +retry).join(",");
36723672
}
36733673
if (tags && tags.length > 0) {
36743674
q += ` tag:${tags}`;

packages/sdk/dist/node/index.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@ecency/sdk",
33
"private": false,
4-
"version": "1.3.9",
5-
"description": "Ecency sdk",
4+
"version": "1.4.0",
5+
"description": "Ecency SDK",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/ecency/vision-next.git",

0 commit comments

Comments
 (0)