FIX: show lock glyph to a user without permissions to see quote (#6854)

This commit is contained in:
Maja Komel 2019-01-10 02:48:05 +01:00 committed by Guo Xiang Tan
parent cb0f6d653b
commit 51b13ec86f
1 changed files with 3 additions and 2 deletions

View File

@ -163,9 +163,10 @@ export default class PostCooked {
$blockQuote.showHtml(div, "fast", finished);
})
.catch(e => {
if (e.jqXHR.status === 404) {
if ([403, 404].includes(e.jqXHR.status)) {
const icon = e.jqXHR.status === 403 ? "lock" : "trash-o";
$blockQuote.showHtml(
$(`<div class='expanded-quote'>${iconHTML("trash-o")}</div>`),
$(`<div class='expanded-quote'>${iconHTML(icon)}</div>`),
"fast",
finished
);