fix(ui): сохранять точный выбор пира при экспорте WireGuard
This commit is contained in:
1 parent
4aa4726c6b
commit
425a77a1ca
8 files changed
+68
-10
No files matched your search
@@ -0,0 +1,4 @@
|
||||
/** An explicit missing selection must never fall back to another peer. */
|
||||
export function selectWgExportPeer<T extends { id?: string; rosId?: string }>(peers: readonly T[], peerId?: string | null): T | undefined {
|
||||
return peerId == null ? peers[0] : peers.find(peer => peer.id === peerId || peer.rosId === peerId)
|
||||
}
|
||||
Reference in new issue
Block a user