Skip to content

Commit

Permalink
💄 style: do not show noDescription in new sesstion (lobehub#2749)
Browse files Browse the repository at this point in the history
* perf: do not show noDescription in new sesstion

* fix: ci error
  • Loading branch information
tisfeng authored Jun 9, 2024
1 parent dd42080 commit 30b00aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/store/session/slices/session/selectors/meta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('sessionMetaSelectors', () => {
it('should return the default description if none is defined in the meta data', () => {
const meta: MetaData = {};
const description = sessionMetaSelectors.getDescription(meta);
expect(description).toBe('noDescription'); // Assuming translation returns this key
expect(description).toBe(undefined); // Assuming translation returns this key
});
});
});
6 changes: 3 additions & 3 deletions src/store/session/slices/session/selectors/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const currentAgentMeta = (s: SessionStore): MetaData => {
const defaultMeta = {
avatar: isInbox ? DEFAULT_INBOX_AVATAR : DEFAULT_AVATAR,
backgroundColor: DEFAULT_BACKGROUND_COLOR,
description: isInbox ? t('inbox.desc', { ns: 'chat' }) : t('noDescription'),
description: isInbox ? t('inbox.desc', { ns: 'chat' }) : undefined,
title: isInbox ? t('inbox.title', { ns: 'chat' }) : t('defaultSession'),
};

Expand All @@ -30,8 +30,8 @@ const currentAgentBackgroundColor = (s: SessionStore) => currentAgentMeta(s).bac

const getAvatar = (s: MetaData) => s.avatar || DEFAULT_AVATAR;
const getTitle = (s: MetaData) => s.title || t('defaultSession', { ns: 'common' });
export const getDescription = (s: MetaData) =>
s.description || t('noDescription', { ns: 'common' });
// New session do not show 'noDescription'
export const getDescription = (s: MetaData) => s.description;

export const sessionMetaSelectors = {
currentAgentAvatar,
Expand Down

0 comments on commit 30b00aa

Please sign in to comment.