@@ -5,6 +5,7 @@ import style from 'src/utils/style.js';
55import onPage from 'src/utils/onPage.js' ;
66import { max } from 'src/utils/cardHelper.js' ;
77import Translation from 'src/structures/constants/translation.ts' ;
8+ import Priority from 'src/structures/constants/priority.js' ;
89import { getTranslationArray } from '../underscript/translation.js' ;
910
1011export const crafting = onPage ( 'Crafting' ) ;
@@ -114,7 +115,7 @@ eventManager.on(':preload:Decks :preload:Crafting', () => {
114115 if ( setting . value ( ) ) return this . super ( card ) ;
115116 const results = new Map ( ) ;
116117 return filters . reduce ( ( removed , func ) => {
117- if ( ! func ) return removed ;
118+ if ( typeof func !== 'function' ) return removed ;
118119 const val = func . call ( this , card , removed , Object . fromEntries ( results ) ) ;
119120 const key = func . displayName || func . name ;
120121 if ( typeof val === 'boolean' ) {
@@ -161,6 +162,7 @@ function ownSelect() {
161162}
162163
163164filters . push (
165+ Priority . FIRST ,
164166 // function isRemoved(card) {
165167 // // Shiny, Rarity, Type, Extension, Search
166168 // return this.super(card);
@@ -213,6 +215,8 @@ filters.push(
213215 ! card . tribes . some ( ( t ) => includes ( $ . i18n ( `tribe-${ t . toLowerCase ( ) . replace ( / _ / g, '-' ) } ` ) ) )
214216 ) ;
215217 } ,
218+ Priority . HIGHEST ,
219+ Priority . HIGH ,
216220 crafting && function baseGenFilter ( card , removed ) {
217221 if ( removed || $ ( '.rarityInput:checked' ) . length ) return null ;
218222 return [ 'BASE' , 'TOKEN' ] . includes ( card . rarity ) ;
@@ -233,4 +237,8 @@ filters.push(
233237 default : return false ;
234238 }
235239 } ,
240+ Priority . NORMAL ,
241+ Priority . LOW ,
242+ Priority . LOWEST ,
243+ Priority . LAST ,
236244) ;
0 commit comments