diff --git a/package.json b/package.json index bf9c4f8a..07b64092 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photon-lemmy", - "version": "0.9.24", + "version": "0.9.26", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/routes/modlog/+page.ts b/src/routes/modlog/+page.ts index 1d6a5d89..86916a3c 100644 --- a/src/routes/modlog/+page.ts +++ b/src/routes/modlog/+page.ts @@ -28,7 +28,9 @@ export type ActionName = | 'unban' | 'unbanCommunity' | 'postRemoval' + | 'postRestore' | 'commentRemoval' + | 'commentRestore' | 'postLock' | 'postUnlock' | 'postUnfeature' @@ -83,7 +85,9 @@ export const _toModLog = (item: ModAction): ModLog => { } } else if ('mod_remove_comment' in item) { return { - actionName: 'commentRemoval', + actionName: item.mod_remove_comment.removed + ? 'commentRemoval' + : 'commentRestore', community: item.community, content: item.comment.content, timestamp: timestamp(item.mod_remove_comment.when_), @@ -94,7 +98,7 @@ export const _toModLog = (item: ModAction): ModLog => { } } else if ('mod_remove_post' in item) { return { - actionName: 'postRemoval', + actionName: item.mod_remove_post.removed ? 'postRemoval' : 'postRestore', community: item.community, content: item.post.name, timestamp: timestamp(item.mod_remove_post.when_), diff --git a/src/routes/modlog/ModlogAction.svelte b/src/routes/modlog/ModlogAction.svelte index 37eb12d4..109f3562 100644 --- a/src/routes/modlog/ModlogAction.svelte +++ b/src/routes/modlog/ModlogAction.svelte @@ -58,6 +58,13 @@ text: 'Removal', } } + case 'commentRestore': { + return { + icon: Trash, + class: 'text-green-600 dark:text-green-400', + text: 'Restoration', + } + } case 'postRemoval': { return { icon: Trash, @@ -65,6 +72,13 @@ text: 'Removal', } } + case 'postRestore': { + return { + icon: Trash, + class: 'text-green-600 dark:text-green-400', + text: 'Restoration', + } + } case 'modAdd': { return { icon: UserPlus,