Fix: Prevent data loss on bulk regex move to scoped scripts (#4760) * Fix: Prevent data loss in regex bulk move * prevents moving to scoped scripts with group selected for bulkedit
Signed| @@ -1855,6 +1855,14 @@ jQuery(async () => { | ||
| 1855 | 1855 | }); |
| 1856 | 1856 | |
| 1857 | 1857 | $('#bulk_regex_move_to_scoped').on('click', async () => { |
| 1858 | + if (this_chid === undefined) { | |
| 1859 | + toastr.error(t`No character selected.`); | |
| 1860 | + return; | |
| 1861 | + } | |
| 1862 | + if (selected_group) { | |
| 1863 | + toastr.error(t`Cannot edit scoped scripts in group chats.`); | |
| 1864 | + return; | |
| 1865 | + } | |
| 1858 | 1866 | const confirm = await callGenericPopup(t`Are you sure you want to move the selected regex scripts to scoped?`, POPUP_TYPE.CONFIRM); |
| 1859 | 1867 | if (!confirm) { |
| 1860 | 1868 | return; |