refac
This commit is contained in:
@@ -163,7 +163,9 @@
|
||||
const hasPublicWriteGrant = (grants: AccessGrant[]): boolean =>
|
||||
grants.some(
|
||||
(grant) =>
|
||||
grant.principal_type === 'user' && grant.principal_id === '*' && grant.permission === 'write'
|
||||
grant.principal_type === 'user' &&
|
||||
grant.principal_id === '*' &&
|
||||
grant.permission === 'write'
|
||||
);
|
||||
|
||||
const currentGrants = (): AccessGrant[] =>
|
||||
@@ -203,11 +205,7 @@
|
||||
const setPublic = (isPublic: boolean) => {
|
||||
// Remove all user:* grants
|
||||
const filtered = currentGrants().filter(
|
||||
(grant) =>
|
||||
!(
|
||||
grant.principal_type === 'user' &&
|
||||
grant.principal_id === '*'
|
||||
)
|
||||
(grant) => !(grant.principal_type === 'user' && grant.principal_id === '*')
|
||||
);
|
||||
if (isPublic) {
|
||||
filtered.push({
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
onChange={() => onChange(value)}
|
||||
>
|
||||
<svelte:fragment slot="trigger" let:selectedLabel>
|
||||
<span class="inline-flex h-input px-0.5 w-full outline-hidden bg-transparent truncate placeholder-gray-400 focus:outline-hidden">
|
||||
<span
|
||||
class="inline-flex h-input px-0.5 w-full outline-hidden bg-transparent truncate placeholder-gray-400 focus:outline-hidden"
|
||||
>
|
||||
{selectedLabel}
|
||||
</span>
|
||||
<ChevronDown className=" size-3.5" strokeWidth="2.5" />
|
||||
|
||||
Reference in New Issue
Block a user