mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added Cover & Avatar update settings
This commit is contained in:
parent
27c2a26f27
commit
54c5472d86
@ -94,10 +94,56 @@ export default [
|
|||||||
{
|
{
|
||||||
"id": "avatar",
|
"id": "avatar",
|
||||||
"group": "account.profile",
|
"group": "account.profile",
|
||||||
"component": "ImageUpload",
|
"component": "Input",
|
||||||
"icon": "Image",
|
"icon": "Image",
|
||||||
"title": "Avatar",
|
"title": "Avatar",
|
||||||
"description": "Change your avatar",
|
"description": "Change your avatar (Upload an image or use an URL)",
|
||||||
|
"defaultValue": async () => {
|
||||||
|
const userData = await User.data()
|
||||||
|
return userData.avatar
|
||||||
|
},
|
||||||
|
"onUpdate": async (value) => {
|
||||||
|
const selfId = await User.selfUserId()
|
||||||
|
|
||||||
|
const result = window.app.request.post.updateUser({
|
||||||
|
_id: selfId,
|
||||||
|
update: {
|
||||||
|
avatar: value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"debounced": true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "cover",
|
||||||
|
"group": "account.profile",
|
||||||
|
"component": "Input",
|
||||||
|
"icon": "Image",
|
||||||
|
"title": "Cover",
|
||||||
|
"description": "Change your profile cover (Upload an image or use an URL)",
|
||||||
|
"defaultValue": async () => {
|
||||||
|
const userData = await User.data()
|
||||||
|
return userData.cover
|
||||||
|
},
|
||||||
|
"onUpdate": async (value) => {
|
||||||
|
const selfId = await User.selfUserId()
|
||||||
|
|
||||||
|
const result = window.app.request.post.updateUser({
|
||||||
|
_id: selfId,
|
||||||
|
update: {
|
||||||
|
cover: value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"debounced": true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "cover",
|
"id": "cover",
|
||||||
@ -107,14 +153,6 @@ export default [
|
|||||||
"title": "Cover",
|
"title": "Cover",
|
||||||
"description": "Change your cover",
|
"description": "Change your cover",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "primaryBadge",
|
|
||||||
"group": "account.profile",
|
|
||||||
"component": "Select",
|
|
||||||
"icon": "Tag",
|
|
||||||
"title": "Primary badge",
|
|
||||||
"description": "Change your primary badge",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "description",
|
"id": "description",
|
||||||
"group": "account.profile",
|
"group": "account.profile",
|
||||||
@ -148,6 +186,14 @@ export default [
|
|||||||
},
|
},
|
||||||
"debounced": true,
|
"debounced": true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "primaryBadge",
|
||||||
|
"group": "account.profile",
|
||||||
|
"component": "Select",
|
||||||
|
"icon": "Tag",
|
||||||
|
"title": "Primary badge",
|
||||||
|
"description": "Change your primary badge",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "logout",
|
"id": "logout",
|
||||||
"footer": true,
|
"footer": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user