mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(reply modal): add alert when attempting multiple quotes
This commit is contained in:
@@ -28,6 +28,12 @@ const useReplyModalStore = create<ReplyModalState>((set, get) => ({
|
||||
},
|
||||
|
||||
openReplyModal: (parentCid, postCid, subplebbitAddress) => {
|
||||
// Don't update if already open with different parent
|
||||
if (get().activeCid && get().activeCid !== parentCid) {
|
||||
window.alert('Multiple quotes are not possible on 5chan for the time being, because of a protocol limitation. Please reply to one post at a time.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Get selected text
|
||||
const text = document.getSelection()?.toString();
|
||||
if (text) {
|
||||
@@ -38,11 +44,6 @@ const useReplyModalStore = create<ReplyModalState>((set, get) => ({
|
||||
const isMobile = window.innerWidth <= 768; // Simple check, adjust as needed
|
||||
const scrollY = isMobile ? window.scrollY : 0;
|
||||
|
||||
// Don't update if already open with different parent
|
||||
if (get().activeCid && get().activeCid !== parentCid) {
|
||||
return;
|
||||
}
|
||||
|
||||
set({
|
||||
activeCid: parentCid,
|
||||
threadCid: postCid,
|
||||
|
||||
Reference in New Issue
Block a user