fix bug that breaks subscriptions in channels, leaving servers, fix
subscrptions part 6
This commit is contained in:
parent
d0509788ff
commit
5a85d72a51
5 changed files with 198 additions and 66 deletions
|
|
@ -241,23 +241,26 @@
|
|||
<Tabs.Content value="general" class="space-y-6 p-4">
|
||||
<div class="space-y-2">
|
||||
<h2 class="text-lg font-medium">Server Settings</h2>
|
||||
<div class="flex items-center gap-4">
|
||||
<Input
|
||||
placeholder="New server name"
|
||||
class="max-w-xs"
|
||||
value={server?.name}
|
||||
oninput={(e) => {
|
||||
server.name = e.currentTarget.value;
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
variant="outline"
|
||||
onclick={() => toast.info('Server name change would be saved (no backend yet)')}
|
||||
>
|
||||
Save Name
|
||||
</Button>
|
||||
</div>
|
||||
<p class="text-xs text-muted-foreground">Changes are local only (no backend yet)</p>
|
||||
<form
|
||||
method="POST"
|
||||
action="?/changeServerName"
|
||||
use:enhance={() => {
|
||||
return async ({ result }) => {
|
||||
if (result.type === 'success') {
|
||||
toast.success('Server name updated successfully');
|
||||
await invalidateAll();
|
||||
await fill_overview_data(psd);
|
||||
} else if (result.type === 'failure') {
|
||||
toast.error('Failed to update server name: ' + result.data?.error);
|
||||
}
|
||||
};
|
||||
}}
|
||||
class="flex items-center gap-4"
|
||||
>
|
||||
<input type="hidden" name="serverId" value={currentPage} />
|
||||
<Input name="name" placeholder="New server name" class="max-w-xs" value={server?.name} />
|
||||
<Button type="submit" variant="outline">Save Name</Button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue