mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
[next] Prevent accidental lock out from admin or stream (#2084)
* feat: prevent auth lockout by accident * test: add integration tests * test: update snapshots
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
export default function limitSnapshotTo(id: string, node: any) {
|
||||
if (node.props && node.props.id === id) {
|
||||
export default function limitSnapshotTo(dataTest: string, node: any) {
|
||||
if (node.props && node.props["data-test"] === dataTest) {
|
||||
return node;
|
||||
}
|
||||
if (node.children) {
|
||||
for (const child of node.children) {
|
||||
const result: any = limitSnapshotTo(id, child);
|
||||
const result: any = limitSnapshotTo(dataTest, child);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user