fix: EditDrawer correctly reads and labels unlisted privacy
- serve/server.py GET adds private:bool to the response (true when privacy is "unlisted" or legacy "private") so EditDrawer can read it - edit/server.py GET: same fix for the single-user edit server - EditDrawer: fall back to d.privacy if d.private is absent; rename "Private" toggle label to "Unlisted"
This commit is contained in:
@@ -54,7 +54,9 @@
|
||||
// Strip any auto-inserted image markdown refs — images are tracked via custom.images
|
||||
description = (d.description ?? '').replace(/!\[[^\]]*\]\([^)]+\)\n?/g, '').trim();
|
||||
highlight = d.highlight ?? false;
|
||||
isPrivate = d.private ?? false;
|
||||
// d.private is a bool (from the API); d.privacy is the raw field on older
|
||||
// endpoints. Accept either so the drawer works with both serve and edit servers.
|
||||
isPrivate = d.private ?? (d.privacy === 'unlisted' || d.privacy === 'private') ?? false;
|
||||
hideStats = d.hide_stats ?? [];
|
||||
images = d.images ?? [];
|
||||
} catch (e: any) {
|
||||
@@ -286,7 +288,7 @@
|
||||
style={isPrivate ? 'background:rgba(239,68,68,.1)' : ''}
|
||||
on:click={() => isPrivate = !isPrivate}
|
||||
>
|
||||
⊘ Private
|
||||
⊘ Unlisted
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user