mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-28 22:51:03 -07:00
19 lines
542 B
TypeScript
19 lines
542 B
TypeScript
import { BackendService } from '../../services/BackendService';
|
|
import { SessionPersistence } from '../../persistence';
|
|
|
|
export function addToBuddyList(userName: string): void {
|
|
addToList('buddy', userName);
|
|
}
|
|
|
|
export function addToIgnoreList(userName: string): void {
|
|
addToList('ignore', userName);
|
|
}
|
|
|
|
export function addToList(list: string, userName: string): void {
|
|
BackendService.sendSessionCommand('Command_AddToList', { list, userName }, {
|
|
onSuccess: () => {
|
|
SessionPersistence.addToList(list, userName);
|
|
},
|
|
});
|
|
}
|