File tree Expand file tree Collapse file tree
core/components/PlayerDatabase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export type DatabaseActionBaseType = {
2323 author : string ;
2424 timestamp : number ;
2525 //FIXME: the revocation object itself should be optional instead of nullable properties
26+ //BUT DO REMEMBER THE `'XXX' IN YYY` ISSUE!
2627 revocation : {
2728 timestamp : number | null ;
2829 author : string | null ;
@@ -35,7 +36,7 @@ export type DatabaseActionBanType = {
3536} & DatabaseActionBaseType ;
3637export type DatabaseActionWarnType = {
3738 type : 'warn' ;
38- expiration : false ; //FIXME: remove
39+ expiration : false ; //FIXME: remove - BUT DO REMEMBER THE `'XXX' IN YYY` ISSUE!
3940 acked : boolean ; //if the player has acknowledged the warning
4041} & DatabaseActionBaseType ;
4142export type DatabaseActionType = DatabaseActionBanType | DatabaseActionWarnType ;
Original file line number Diff line number Diff line change @@ -206,9 +206,12 @@ export default class PlayerDatabase {
206206 if ( hwidsArray && ! Array . isArray ( hwidsArray ) ) throw new Error ( 'hwidsArray should be an array or undefined' ) ;
207207 const idsFilter = ( action : DatabaseActionType ) => idsArray . some ( ( fi ) => action . ids . includes ( fi ) )
208208 const hwidsFilter = ( action : DatabaseActionType ) => {
209- if ( ! ( 'hwids' in action ) ) return false ;
210- const count = hwidsArray ! . filter ( ( fi ) => action . hwids ! . includes ( fi ) ) . length
211- return count >= this . config . requiredBanHwidMatches ;
209+ if ( 'hwids' in action && action . hwids ) {
210+ const count = hwidsArray ! . filter ( ( fi ) => action . hwids ?. includes ( fi ) ) . length ;
211+ return count >= this . config . requiredBanHwidMatches ;
212+ } else {
213+ return false ;
214+ }
212215 }
213216
214217 try {
You can’t perform that action at this time.
0 commit comments