some
This commit is contained in:
parent
ff66cd7bf0
commit
3437cea13c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "telegram-invite-automation",
|
"name": "telegram-invite-automation",
|
||||||
"version": "1.5.0",
|
"version": "1.6.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Automated user parsing and invites for Telegram groups",
|
"description": "Automated user parsing and invites for Telegram groups",
|
||||||
"main": "src/main/index.js",
|
"main": "src/main/index.js",
|
||||||
|
|||||||
@ -108,13 +108,9 @@ export default function useTaskActions({
|
|||||||
setTaskNotice({ text: `Автоназначены аккаунты: ${accountIds.length}`, tone: "success", source });
|
setTaskNotice({ text: `Автоназначены аккаунты: ${accountIds.length}`, tone: "success", source });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!accountIds.length) {
|
const hasNoAccounts = !accountIds.length;
|
||||||
if (!silent) {
|
|
||||||
showNotification("Нет аккаунтов для этой задачи.", "error");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const roleEntries = Object.values(accountRolesMap);
|
const roleEntries = Object.values(accountRolesMap);
|
||||||
|
if (accountIds.length > 0) {
|
||||||
if (roleEntries.length) {
|
if (roleEntries.length) {
|
||||||
const hasMonitor = roleEntries.some((item) => item.monitor);
|
const hasMonitor = roleEntries.some((item) => item.monitor);
|
||||||
const hasInvite = roleEntries.some((item) => item.invite);
|
const hasInvite = roleEntries.some((item) => item.invite);
|
||||||
@ -152,6 +148,13 @@ export default function useTaskActions({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (!silent) {
|
||||||
|
setTaskNotice({
|
||||||
|
text: "Задача сохранена как черновик. Добавьте аккаунты во вкладке «Аккаунты».",
|
||||||
|
tone: "warn",
|
||||||
|
source
|
||||||
|
});
|
||||||
|
}
|
||||||
const accountRoles = Object.entries(accountRolesMap).map(([id, roles]) => ({
|
const accountRoles = Object.entries(accountRolesMap).map(([id, roles]) => ({
|
||||||
accountId: Number(id),
|
accountId: Number(id),
|
||||||
roleMonitor: Boolean(roles.monitor),
|
roleMonitor: Boolean(roles.monitor),
|
||||||
@ -167,7 +170,13 @@ export default function useTaskActions({
|
|||||||
});
|
});
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
setTaskNotice({ text: "Задача сохранена.", tone: "success", source });
|
setTaskNotice({
|
||||||
|
text: hasNoAccounts
|
||||||
|
? "Задача сохранена как черновик. Добавьте аккаунты во вкладке «Аккаунты»."
|
||||||
|
: "Задача сохранена.",
|
||||||
|
tone: hasNoAccounts ? "warn" : "success",
|
||||||
|
source
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setAutosaveNote("Автосохранено");
|
setAutosaveNote("Автосохранено");
|
||||||
if (autosaveNoteTimer.current) {
|
if (autosaveNoteTimer.current) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user