TSK-903: do not allow saving if set to private with no members (#2854)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-03-29 21:16:30 +05:00 committed by GitHub
parent f78eccb6d0
commit 24a4fa3b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,7 @@
label={isNew ? tracker.string.NewProject : tracker.string.EditProject}
okLabel={isNew ? presentation.string.Create : presentation.string.Save}
okAction={handleSave}
canSave={name.length > 0 && !!selectedWorkDayType}
canSave={name.length > 0 && !!selectedWorkDayType && !(members.length === 0 && isPrivate)}
on:close={() => {
dispatch('close')
}}
@ -153,6 +153,7 @@
label={presentation.string.MakePrivate}
description={presentation.string.MakePrivateDescription}
bind:on={isPrivate}
disabled={!isPrivate && members.length === 0}
/>
<div class="flex-between">
<div class="caption">