mirror of
https://github.com/ragestudio/comty.git
synced 2025-07-08 08:44:15 +00:00
Fix unset public name action to call unsetPublicName method
This commit is contained in:
parent
e3d8d25391
commit
a0c82c3cae
@ -11,7 +11,7 @@ export default {
|
||||
const userData = await UserModel.data()
|
||||
|
||||
return {
|
||||
userData
|
||||
userData,
|
||||
}
|
||||
},
|
||||
settings: [
|
||||
@ -21,7 +21,8 @@ export default {
|
||||
component: "Button",
|
||||
icon: "FiAtSign",
|
||||
title: "Username",
|
||||
description: "Your username is the name you use to log in to your account.",
|
||||
description:
|
||||
"Your username is the name you use to log in to your account.",
|
||||
props: {
|
||||
disabled: true,
|
||||
children: "Change username",
|
||||
@ -45,7 +46,7 @@ export default {
|
||||
},
|
||||
onUpdate: async (value) => {
|
||||
const result = await UserModel.updateData({
|
||||
public_name: value
|
||||
public_name: value,
|
||||
})
|
||||
|
||||
if (result) {
|
||||
@ -55,13 +56,13 @@ export default {
|
||||
},
|
||||
extraActions: [
|
||||
{
|
||||
"id": "unset",
|
||||
"icon": "Delete",
|
||||
"title": "Unset",
|
||||
"onClick": async () => {
|
||||
await UserModel.unsetFullName()
|
||||
}
|
||||
}
|
||||
id: "unset",
|
||||
icon: "Delete",
|
||||
title: "Unset",
|
||||
onClick: async () => {
|
||||
await UserModel.unsetPublicName()
|
||||
},
|
||||
},
|
||||
],
|
||||
debounced: true,
|
||||
storaged: false,
|
||||
@ -84,7 +85,7 @@ export default {
|
||||
},
|
||||
onUpdate: async (value) => {
|
||||
const result = await UserModel.updateData({
|
||||
email: value
|
||||
email: value,
|
||||
})
|
||||
|
||||
if (result) {
|
||||
@ -100,15 +101,13 @@ export default {
|
||||
title: "Avatar",
|
||||
description: "Change your avatar (Upload an image or use an URL)",
|
||||
component: loadable(() => import("../components/urlInput")),
|
||||
extraActions: [
|
||||
UploadButton
|
||||
],
|
||||
extraActions: [UploadButton],
|
||||
defaultValue: (ctx) => {
|
||||
return ctx.userData.avatar
|
||||
},
|
||||
onUpdate: async (value) => {
|
||||
const result = await UserModel.updateData({
|
||||
avatar: value
|
||||
avatar: value,
|
||||
})
|
||||
|
||||
if (result) {
|
||||
@ -122,17 +121,16 @@ export default {
|
||||
group: "account.profile",
|
||||
icon: "FiImage",
|
||||
title: "Cover",
|
||||
description: "Change your profile cover (Upload an image or use an URL)",
|
||||
description:
|
||||
"Change your profile cover (Upload an image or use an URL)",
|
||||
component: loadable(() => import("../components/urlInput")),
|
||||
extraActions: [
|
||||
UploadButton
|
||||
],
|
||||
extraActions: [UploadButton],
|
||||
defaultValue: (ctx) => {
|
||||
return ctx.userData.cover
|
||||
},
|
||||
onUpdate: async (value) => {
|
||||
const result = await UserModel.updateData({
|
||||
cover: value
|
||||
cover: value,
|
||||
})
|
||||
|
||||
if (result) {
|
||||
@ -152,14 +150,14 @@ export default {
|
||||
placeholder: "Enter here a description for your profile",
|
||||
maxLength: 320,
|
||||
showCount: true,
|
||||
allowClear: true
|
||||
allowClear: true,
|
||||
},
|
||||
defaultValue: (ctx) => {
|
||||
return ctx.userData.description
|
||||
},
|
||||
onUpdate: async (value) => {
|
||||
const result = await UserModel.updateData({
|
||||
description: value
|
||||
description: value,
|
||||
})
|
||||
|
||||
if (result) {
|
||||
@ -182,7 +180,7 @@ export default {
|
||||
})
|
||||
|
||||
const result = await UserModel.updateData({
|
||||
links: value
|
||||
links: value,
|
||||
})
|
||||
|
||||
if (result) {
|
||||
@ -193,6 +191,6 @@ export default {
|
||||
return ctx.userData.links ?? []
|
||||
},
|
||||
debounced: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user