Skip to content

Commit

Permalink
[F] Fix spoiler storage comment
Browse files Browse the repository at this point in the history
  • Loading branch information
LS-KR committed Jul 28, 2024
1 parent 180049b commit faf9f3c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/views/ProfileComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import MarkdownTooltip from "@/components/MarkdownTooltip.vue";
import SubmitPrompt, {CaptchaResponse} from "@/components/SubmitPrompt.vue";
import {backendHost, t} from "@/logic/config";
import {Person, Comment} from "@/logic/data";
import {Comment, Person} from "@/logic/data";
import {fetchText, trim} from "@/logic/helper";
import {error, info} from "@/logic/utils";
import Swal from 'sweetalert2';
Expand All @@ -68,7 +68,7 @@ export default class ProfileComments extends Vue {
trim = trim
getComments(): Comment[] {
const commentData = this.p.comments.map(c => {
const commentData = this.p.comments.map(c => {
return {
...c,
anonymous: c.submitter === "Anonymous",
Expand All @@ -89,7 +89,7 @@ export default class ProfileComments extends Vue {
for (const u of myComments[this.p.id]) {
let flag = true;
for (const v of commentData) {
if ((u.content == v.content)) {
if ((u.content.replaceAll('||', '').replaceAll('\n', '').replaceAll('<br />', '').replaceAll(' ', '') == v.content.replaceAll('<span class="spoiler"><span>', '').replaceAll('</span></span>', '').replaceAll('<br />', '').replaceAll(' ', ''))) {
flag = false;
break;
}
Expand Down Expand Up @@ -152,8 +152,7 @@ export default class ProfileComments extends Vue {
submitter: 'You',
id: 0
}]
}
else {
} else {
myComments[this.p.id].push({
content: this.textInput.replaceAll("\n", "<br />"),
replies: [],
Expand Down

0 comments on commit faf9f3c

Please sign in to comment.