feat(api,userbot,frontend): rename session device from the web ui
This commit is contained in:
1 parent
b1848a6620
commit
1898a51a9d
11 files changed
+207
-13
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user