@@ -80,7 +80,7 @@ function bank.proto:OnShow(ctx)
8080 self .bag .tabs :SetTabByID (ctx , firstTabID )
8181 ctx :Set (" filterBagID" , firstTabID ) -- Set the filter for the initial tab
8282 else
83- self .bag .bankTab = Enum .BagIndex .Bank
83+ self .bag .bankTab = Enum .BagIndex .Characterbanktab
8484 self .bag .tabs :SetTabByID (ctx , 1 )
8585 end
8686 -- Set the active bank type for character bank
420420
421421--- @param ctx Context
422422function bank .proto :SwitchToBank (ctx )
423- self .bag .bankTab = Enum .BagIndex .Bank
423+ self .bag .bankTab = Enum .BagIndex .Characterbanktab
424424 BankFrame .selectedTab = 1
425425 self .bag :SetTitle (L :G (" Bank" ))
426426 self .bag .currentItemCount = - 1
@@ -505,14 +505,18 @@ end
505505--- @param ctx Context
506506function bank .proto :SwitchToBankAndWipe (ctx )
507507 ctx :Set (" wipe" , true )
508- self .bag .tabs :SetTabByID (ctx , 1 )
509- self .bag .bankTab = Enum .BagIndex .Bank
508+ -- Set bankTab first to ensure it's always valid for refresh operations
509+ -- Use Characterbanktab as Bank was removed in TWW 11.2
510+ self .bag .bankTab = Enum .BagIndex .Characterbanktab
510511 BankFrame .selectedTab = 1
511512 BankFrame .activeTabIndex = 1
512513 -- Set the active bank type so right-click item movement works correctly
513514 if BankPanel and BankPanel .SetBankType then
514515 BankPanel :SetBankType (Enum .BankType .Character )
515516 end
517+ if self .bag .tabs then
518+ self .bag .tabs :SetTabByID (ctx , 1 )
519+ end
516520 self .bag :SetTitle (L :G (" Bank" ))
517521 items :ClearBankCache (ctx )
518522 self .bag :Wipe (ctx )
0 commit comments