fix: add comment and post restore
This commit is contained in:
1 parent
b1dc2173e9
commit
8f0f2b0919
3 files changed
+21
-3
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "photon-lemmy",
|
"name": "photon-lemmy",
|
||||||
"version": "0.9.24",
|
"version": "0.9.26",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ export type ActionName =
|
|||||||
| 'unban'
|
| 'unban'
|
||||||
| 'unbanCommunity'
|
| 'unbanCommunity'
|
||||||
| 'postRemoval'
|
| 'postRemoval'
|
||||||
|
| 'postRestore'
|
||||||
| 'commentRemoval'
|
| 'commentRemoval'
|
||||||
|
| 'commentRestore'
|
||||||
| 'postLock'
|
| 'postLock'
|
||||||
| 'postUnlock'
|
| 'postUnlock'
|
||||||
| 'postUnfeature'
|
| 'postUnfeature'
|
||||||
@@ -83,7 +85,9 @@ export const _toModLog = (item: ModAction): ModLog => {
|
|||||||
}
|
}
|
||||||
} else if ('mod_remove_comment' in item) {
|
} else if ('mod_remove_comment' in item) {
|
||||||
return {
|
return {
|
||||||
actionName: 'commentRemoval',
|
actionName: item.mod_remove_comment.removed
|
||||||
|
? 'commentRemoval'
|
||||||
|
: 'commentRestore',
|
||||||
community: item.community,
|
community: item.community,
|
||||||
content: item.comment.content,
|
content: item.comment.content,
|
||||||
timestamp: timestamp(item.mod_remove_comment.when_),
|
timestamp: timestamp(item.mod_remove_comment.when_),
|
||||||
@@ -94,7 +98,7 @@ export const _toModLog = (item: ModAction): ModLog => {
|
|||||||
}
|
}
|
||||||
} else if ('mod_remove_post' in item) {
|
} else if ('mod_remove_post' in item) {
|
||||||
return {
|
return {
|
||||||
actionName: 'postRemoval',
|
actionName: item.mod_remove_post.removed ? 'postRemoval' : 'postRestore',
|
||||||
community: item.community,
|
community: item.community,
|
||||||
content: item.post.name,
|
content: item.post.name,
|
||||||
timestamp: timestamp(item.mod_remove_post.when_),
|
timestamp: timestamp(item.mod_remove_post.when_),
|
||||||
|
|||||||
@@ -58,6 +58,13 @@
|
|||||||
text: 'Removal',
|
text: 'Removal',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case 'commentRestore': {
|
||||||
|
return {
|
||||||
|
icon: Trash,
|
||||||
|
class: 'text-green-600 dark:text-green-400',
|
||||||
|
text: 'Restoration',
|
||||||
|
}
|
||||||
|
}
|
||||||
case 'postRemoval': {
|
case 'postRemoval': {
|
||||||
return {
|
return {
|
||||||
icon: Trash,
|
icon: Trash,
|
||||||
@@ -65,6 +72,13 @@
|
|||||||
text: 'Removal',
|
text: 'Removal',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case 'postRestore': {
|
||||||
|
return {
|
||||||
|
icon: Trash,
|
||||||
|
class: 'text-green-600 dark:text-green-400',
|
||||||
|
text: 'Restoration',
|
||||||
|
}
|
||||||
|
}
|
||||||
case 'modAdd': {
|
case 'modAdd': {
|
||||||
return {
|
return {
|
||||||
icon: UserPlus,
|
icon: UserPlus,
|
||||||
|
|||||||
Reference in new issue
Block a user