Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
bentwnghk committed Aug 19, 2024
2 parents 842f5de + 9f55c0a commit fba9f4a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"systemjs": "^6.15.1",
"ts-md5": "^1.3.1",
"ua-parser-js": "^1.0.38",
"unstructured-client": "^0.11.3",
"unstructured-client": "^0.15.0",
"url-join": "^5.0.0",
"use-merge-value": "^1.2.0",
"utility-types": "^3.11.0",
Expand Down Expand Up @@ -283,7 +283,7 @@
"vitest": "~1.2.2",
"vitest-canvas-mock": "^0.3.3"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].1",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useSessionStore } from '@/store/session';
import { useUserStore } from '@/store/user';
import { ChatTopic } from '@/types/topic';

import { Placeholder, SkeletonList } from '../SkeletonList';
import { SkeletonList } from '../SkeletonList';
import TopicItem from './TopicItem';

const TopicListContent = memo(() => {
Expand Down Expand Up @@ -85,18 +85,18 @@ const TopicListContent = memo(() => {
</Flexbox>
)}
<Virtuoso
components={{ ScrollSeekPlaceholder: Placeholder }}
// components={{ ScrollSeekPlaceholder: Placeholder }}
computeItemKey={(_, item) => item.id}
data={topics}
fixedItemHeight={44}
initialTopMostItemIndex={Math.max(activeIndex, 0)}
itemContent={itemContent}
overscan={44 * 10}
ref={virtuosoRef}
scrollSeekConfiguration={{
enter: (velocity) => Math.abs(velocity) > 350,
exit: (velocity) => Math.abs(velocity) < 10,
}}
// scrollSeekConfiguration={{
// enter: (velocity) => Math.abs(velocity) > 350,
// exit: (velocity) => Math.abs(velocity) < 10,
// }}
/>
</>
);
Expand Down
5 changes: 2 additions & 3 deletions src/app/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Metadata } from 'next';

import { appEnv, getAppConfig } from '@/config/app';
import { appEnv } from '@/config/app';
import { OFFICIAL_URL, OG_URL } from '@/const/url';
import { translation } from '@/server/translation';

const title = 'Mr.🆖 AI';

const { SITE_URL = OFFICIAL_URL } = getAppConfig();
const BASE_PATH = appEnv.NEXT_PUBLIC_BASE_PATH;

// if there is a base path, then we don't need the manifest
Expand All @@ -27,7 +26,7 @@ export const generateMetadata = async (): Promise<Metadata> => {
shortcut: '/favicon-32x32.ico?v=1',
},
manifest: noManifest ? undefined : '/manifest.json',
metadataBase: new URL(SITE_URL),
metadataBase: new URL(OFFICIAL_URL),
openGraph: {
description: t('chat.description'),
images: [
Expand Down
4 changes: 2 additions & 2 deletions src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getAppConfig = () => {
PLUGINS_INDEX_URL: z.string().url(),
PLUGIN_SETTINGS: z.string().optional(),

SITE_URL: z.string().optional(),
APP_URL: z.string().optional(),
},
runtimeEnv: {
NEXT_PUBLIC_BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH || '',
Expand All @@ -52,7 +52,7 @@ export const getAppConfig = () => {
: 'https://chat-plugins.lobehub.com',

PLUGIN_SETTINGS: process.env.PLUGIN_SETTINGS,
SITE_URL: process.env.SITE_URL,
APP_URL: process.env.APP_URL,
},
});
};
Expand Down
18 changes: 8 additions & 10 deletions src/server/ld.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import urlJoin from 'url-join';

import { getAppConfig } from '@/config/app';
import { EMAIL_BUSINESS, EMAIL_SUPPORT, OFFICIAL_SITE, OFFICIAL_URL, X } from '@/const/url';

import pkg from '../../package.json';

const { SITE_URL = OFFICIAL_URL } = getAppConfig();
const LAST_MODIFIED = new Date().toISOString();
export const AUTHOR_LIST = {
arvinxx: {
Expand Down Expand Up @@ -70,7 +68,7 @@ class Ld {

genOrganization() {
return {
'@id': this.getId(SITE_URL, '#organization'),
'@id': this.getId(OFFICIAL_URL, '#organization'),
'@type': 'Organization',
'alternateName': 'Mr.🆖 AI',
'contactPoint': {
Expand Down Expand Up @@ -100,7 +98,7 @@ class Ld {

getAuthors(ids: string[] = []) {
const defaultAuthor = {
'@id': this.getId(SITE_URL, '#organization'),
'@id': this.getId(OFFICIAL_URL, '#organization'),
'@type': 'Organization',
};
if (!ids || ids.length === 0) return defaultAuthor;
Expand Down Expand Up @@ -140,7 +138,7 @@ class Ld {
'@id': fixedUrl,
'@type': 'WebPage',
'about': {
'@id': this.getId(SITE_URL, '#organization'),
'@id': this.getId(OFFICIAL_URL, '#organization'),
},
'breadcrumbs': {
'@id': this.getId(fixedUrl, '#breadcrumb'),
Expand All @@ -153,7 +151,7 @@ class Ld {
},
'inLanguage': 'en-US',
'isPartOf': {
'@id': this.getId(SITE_URL, '#website'),
'@id': this.getId(OFFICIAL_URL, '#website'),
},
'name': this.fixTitle(title),
'primaryImageOfPage': {
Expand Down Expand Up @@ -186,15 +184,15 @@ class Ld {

genWebSite() {
const baseInfo: any = {
'@id': this.getId(SITE_URL, '#website'),
'@id': this.getId(OFFICIAL_URL, '#website'),
'@type': 'WebSite',
'description': pkg.description,
'inLanguage': 'en-US',
'name': 'Mr.🆖 AI',
'publisher': {
'@id': this.getId(SITE_URL, '#organization'),
'@id': this.getId(OFFICIAL_URL, '#organization'),
},
'url': SITE_URL,
'url': OFFICIAL_URL,
};

return baseInfo;
Expand All @@ -209,7 +207,7 @@ class Ld {
}

private fixUrl(url: string) {
return urlJoin(SITE_URL, url);
return urlJoin(OFFICIAL_URL, url);
}
}

Expand Down
1 change: 1 addition & 0 deletions vitest.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
coverage: {
all: false,
exclude: ['src/database/server/core/dbForTest.ts'],
include: ['src/database/server/**/*.ts'],
provider: 'v8',
reporter: ['text', 'json', 'lcov', 'text-summary'],
reportsDirectory: './coverage/server',
Expand Down

0 comments on commit fba9f4a

Please sign in to comment.