mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: remove v1 prefix in store name
This commit is contained in:
@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { convertFileToBase64 } from "@/helpers/utils";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { UserNamePrefix, useUserV1Store } from "@/store/v1";
|
||||
import { UserNamePrefix, useUserStore } from "@/store/v1";
|
||||
import { User as UserPb } from "@/types/proto/api/v2/user_service";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { generateDialog } from "./Dialog";
|
||||
@ -22,7 +22,7 @@ interface State {
|
||||
const UpdateAccountDialog: React.FC<Props> = ({ destroy }: Props) => {
|
||||
const t = useTranslate();
|
||||
const currentUser = useCurrentUser();
|
||||
const userV1Store = useUserV1Store();
|
||||
const userStore = useUserStore();
|
||||
const [state, setState] = useState<State>({
|
||||
avatarUrl: currentUser.avatarUrl,
|
||||
username: currentUser.name.replace(UserNamePrefix, ""),
|
||||
@ -108,7 +108,7 @@ const UpdateAccountDialog: React.FC<Props> = ({ destroy }: Props) => {
|
||||
if (!isEqual(currentUser.email, state.email)) {
|
||||
updateMask.push("email");
|
||||
}
|
||||
await userV1Store.updateUser(
|
||||
await userStore.updateUser(
|
||||
UserPb.fromPartial({
|
||||
name: `${UserNamePrefix}${state.username}`,
|
||||
id: currentUser.id,
|
||||
|
Reference in New Issue
Block a user