Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Commit

Permalink
client: Never hide own posts
Browse files Browse the repository at this point in the history
  • Loading branch information
bakape committed Apr 19, 2019
1 parent 1abcaba commit 1c99800
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/posts/hide.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Hide posts you don't like

import { storeHidden, hidden, posts } from "../state"
import { storeHidden, hidden, posts, mine } from "../state"
import { Post } from "./model"
import { clearStore } from "../db"
import { trigger } from "../util"
Expand All @@ -25,7 +25,7 @@ export function clearHidden() {

// Hide all posts that reply to post recursively
export function hideRecursively(post: Post) {
if (post.hidden) {
if (post.hidden || mine.has(post.id)) {
return
}
post.hide()
Expand Down
4 changes: 2 additions & 2 deletions client/posts/menu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { View } from "../base"
import { Post } from "./model"
import { getModel } from "../state"
import { getModel, mine } from "../state"
import { on, postJSON, HTML } from "../util"
import { FormView } from "../ui"
import lang from "../lang"
Expand Down Expand Up @@ -121,7 +121,7 @@ const actions: { [key: string]: ItemSpec } = {
hide: {
text: lang.posts["hide"],
shouldRender(m) {
return true
return !mine.has(m.id);
},
handler: hidePost,
},
Expand Down

0 comments on commit 1c99800

Please sign in to comment.