Merge pull request #18564 from iPagar/empty-names

fix: validate folder and channel names before creation
This commit is contained in:
Tim Baek
2025-10-25 22:30:53 -07:00
committed by GitHub
3 changed files with 10 additions and 1 deletions
+8 -1
View File
@@ -129,7 +129,8 @@
};
const createFolder = async ({ name, data }) => {
if (name === '') {
name = name?.trim();
if (!name) {
toast.error($i18n.t('Folder name cannot be empty.'));
return;
}
@@ -479,6 +480,12 @@
<ChannelModal
bind:show={showCreateChannel}
onSubmit={async ({ name, access_control }) => {
name = name?.trim();
if (!name) {
toast.error($i18n.t('Channel name cannot be empty.'));
return;
}
const res = await createNewChannel(localStorage.token, {
name: name,
access_control: access_control