feat(api,userbot,frontend): rename session device from the web ui

This commit is contained in:
hh committed 2026-08-06 00:51:58 +02:00
1 parent b1848a6620
commit 1898a51a9d
11 files changed
+207 -13

No files matched your search

+11 -1
View File
@@ -1,5 +1,9 @@
import { browser } from "$app/environment";
import { listAccounts, logoutAccount } from "$lib/api/endpoints";
import {
listAccounts,
logoutAccount,
renameAccountDevice,
} from "$lib/api/endpoints";
import type { Account } from "$lib/api/types";
const STORAGE_KEY = "bg.account";
@@ -63,6 +67,12 @@ function createAccounts() {
},
load,
select,
async renameDevice(id: number, deviceModel: string) {
const updated = await renameAccountDevice(id, deviceModel);
list = list.map((account) =>
account.account_id === id ? updated : account
);
},
async logout(id: number) {
await logoutAccount(id);
if (id === selectedId) {