mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
🐛 fix: fix subscription plan tag display (#8599)
This commit is contained in:
@@ -30,9 +30,10 @@ export interface UserInfoProps extends FlexboxProps {
|
||||
const UserInfo = memo<UserInfoProps>(({ avatarProps, onClick, ...rest }) => {
|
||||
const { styles, theme } = useStyles();
|
||||
const isSignedIn = useUserStore(authSelectors.isLogin);
|
||||
const [nickname, username] = useUserStore((s) => [
|
||||
const [nickname, username, subscriptionPlan] = useUserStore((s) => [
|
||||
userProfileSelectors.nickName(s),
|
||||
userProfileSelectors.username(s),
|
||||
s.subscriptionPlan,
|
||||
]);
|
||||
|
||||
return (
|
||||
@@ -52,7 +53,7 @@ const UserInfo = memo<UserInfoProps>(({ avatarProps, onClick, ...rest }) => {
|
||||
<div className={styles.username}>{username}</div>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
{isSignedIn && <PlanTag />}
|
||||
{isSignedIn && <PlanTag type={subscriptionPlan} />}
|
||||
</Flexbox>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -113,6 +113,7 @@ export const createCommonSlice: StateCreator<
|
||||
preference,
|
||||
serverLanguageModel: serverConfig.languageModel,
|
||||
settings: data.settings || {},
|
||||
subscriptionPlan: data.subscriptionPlan,
|
||||
user,
|
||||
},
|
||||
false,
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { Plans } from '@/types/subscription';
|
||||
|
||||
export interface CommonState {
|
||||
isOnboard: boolean;
|
||||
isShowPWAGuide: boolean;
|
||||
isUserCanEnableTrace: boolean;
|
||||
isUserHasConversation: boolean;
|
||||
isUserStateInit: boolean;
|
||||
subscriptionPlan?: Plans;
|
||||
}
|
||||
|
||||
export const initialCommonState: CommonState = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { PartialDeep } from 'type-fest';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { Plans } from '@/types/subscription';
|
||||
import { TopicDisplayMode } from '@/types/topic';
|
||||
import { UserSettings } from '@/types/user/settings';
|
||||
|
||||
@@ -56,6 +57,7 @@ export interface UserInitializationState {
|
||||
lastName?: string;
|
||||
preference: UserPreference;
|
||||
settings: PartialDeep<UserSettings>;
|
||||
subscriptionPlan?: Plans;
|
||||
userId?: string;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user