mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(mod queue): items shouldn't disappear from feed unless api removes them
This commit is contained in:
@@ -166,6 +166,11 @@
|
|||||||
color: var(--mod-queue-button-text-color-hover);
|
color: var(--mod-queue-button-text-color-hover);
|
||||||
text-decoration: var(--mod-queue-button-text-decoration);
|
text-decoration: var(--mod-queue-button-text-decoration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.approve {
|
.approve {
|
||||||
@@ -270,6 +275,11 @@
|
|||||||
background: var(--button-background-color-mobile);
|
background: var(--button-background-color-mobile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ const ModQueueRow = ({ comment, showBoardColumn = false }: ModQueueRowProps) =>
|
|||||||
await approve();
|
await approve();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
} finally {
|
||||||
setIsModerating(false);
|
setIsModerating(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -63,14 +64,11 @@ const ModQueueRow = ({ comment, showBoardColumn = false }: ModQueueRowProps) =>
|
|||||||
await reject();
|
await reject();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
} finally {
|
||||||
setIsModerating(false);
|
setIsModerating(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isModerating) {
|
|
||||||
return null; // Or show a loading state / fade out
|
|
||||||
}
|
|
||||||
|
|
||||||
const excerpt = title || content || (getHasThumbnail(getCommentMediaInfo(link, thumbnailUrl, linkWidth, linkHeight), link) ? t('image') : t('no_content'));
|
const excerpt = title || content || (getHasThumbnail(getCommentMediaInfo(link, thumbnailUrl, linkWidth, linkHeight), link) ? t('image') : t('no_content'));
|
||||||
const postUrl = `/${boardPath}/thread/${threadCid || cid}`;
|
const postUrl = `/${boardPath}/thread/${threadCid || cid}`;
|
||||||
|
|
||||||
@@ -88,10 +86,10 @@ const ModQueueRow = ({ comment, showBoardColumn = false }: ModQueueRowProps) =>
|
|||||||
</div>
|
</div>
|
||||||
<div className={`${styles.time} ${isOverThreshold ? styles.alert : ''}`}>{formatDistanceToNow(timestamp * 1000, { addSuffix: false })}</div>
|
<div className={`${styles.time} ${isOverThreshold ? styles.alert : ''}`}>{formatDistanceToNow(timestamp * 1000, { addSuffix: false })}</div>
|
||||||
<div className={styles.actions}>
|
<div className={styles.actions}>
|
||||||
<button className={`${styles.button} ${styles.approve}`} onClick={handleApprove}>
|
<button className={`${styles.button} ${styles.approve}`} onClick={handleApprove} disabled={isModerating}>
|
||||||
{t('approve')}
|
{t('approve')}
|
||||||
</button>
|
</button>
|
||||||
<button className={`${styles.button} ${styles.reject}`} onClick={handleReject}>
|
<button className={`${styles.button} ${styles.reject}`} onClick={handleReject} disabled={isModerating}>
|
||||||
{t('reject')}
|
{t('reject')}
|
||||||
</button>
|
</button>
|
||||||
<Link to={postUrl} className={styles.button}>
|
<Link to={postUrl} className={styles.button}>
|
||||||
|
|||||||
Reference in New Issue
Block a user