@@ -187,6 +187,21 @@ async function createBulkMoverPopup(sourceWorld, sourceWorldEntries) {
187187 selectWISource . classList . add ( "text_pole" , "wide100p" , "marginTop10" ) ;
188188 selectWISource . appendChild ( WISourceDefaultOption ) ;
189189
190+ /** Give WI selector options. */
191+ let selectableWorldCount = 0 ;
192+ world_names . forEach ( worldName => {
193+ if ( worldName === sourceWorld ) return ;
194+
195+ const option = document . createElement ( "option" ) ;
196+ option . value = world_names . indexOf ( worldName ) . toString ( ) ;
197+ option . textContent = worldName ;
198+ selectWISource . appendChild ( option ) ;
199+ selectableWorldCount ++ ;
200+ } ) ;
201+
202+ // @ts -ignore
203+ if ( selectableWorldCount === 0 ) return toastr . warning ( t `There are no other lorebooks to transfer into` ) ;
204+
190205 const selectSourceEntries = document . createElement ( "select" ) ;
191206 selectSourceEntries . id = "wibm_bulk_move_wi_select_entries" ;
192207 selectSourceEntries . classList . add ( "wide100p" , "marginTop20" , "select2_multi_sameline" , "select2_choice_clickable" , "select2_choice_clickable_buttonstyle" ) ;
@@ -243,21 +258,6 @@ async function createBulkMoverPopup(sourceWorld, sourceWorldEntries) {
243258 log ( "selectSourceEntries.on(change)" , selectedWorldEntries ) ;
244259 } ) ;
245260
246- /** Give WI selector options. */
247- let selectableWorldCount = 0 ;
248- world_names . forEach ( worldName => {
249- if ( worldName === sourceWorld ) return ;
250-
251- const option = document . createElement ( "option" ) ;
252- option . value = world_names . indexOf ( worldName ) . toString ( ) ;
253- option . textContent = worldName ;
254- selectWISource . appendChild ( option ) ;
255- selectableWorldCount ++ ;
256- } ) ;
257-
258- // @ts -ignore
259- if ( selectableWorldCount === 0 ) return toastr . warning ( t `There are no other lorebooks to copy into` ) ;
260-
261261 /** Create popup container and title. */
262262 const wrapper = document . createElement ( "div" ) ;
263263 const container = document . createElement ( "div" ) ;
0 commit comments