Skip to content

Commit 5bb9797

Browse files
fix: fix test channal switch to normal channel
1 parent fe08504 commit 5bb9797

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,15 @@ fn ui_builder() -> impl Widget<AppData> {
271271
let checker_prerelease = Checkbox::new("测试通道")
272272
.on_change(|ctx, old, new, env| {
273273
let sink = ctx.get_external_handle();
274+
let channel = if *new { "test" } else { "versions" };
274275
ctx.get_external_handle()
275276
.add_idle_callback(|data: &mut AppData| {
276277
let ncm_version_ = data.ncm_version.clone();
277-
tokio::spawn(async {
278-
get_adapted_betterncm_version(ncm_version_, sink, "test".to_string())
279-
.await
280-
.unwrap();
281-
});
278+
tokio::spawn(async {
279+
get_adapted_betterncm_version(ncm_version_, sink, channel.to_string())
280+
.await
281+
.unwrap();
282+
});
282283
});
283284
})
284285
.lens(AppData::prerelease);
@@ -473,6 +474,7 @@ fn ui_builder() -> impl Widget<AppData> {
473474
}))
474475
.with_flex_spacer(1.)
475476
.with_child(checker_prerelease)
477+
.with_spacer(5.)
476478
.with_child(
477479
Flex::row()
478480
.with_flex_child(button_install.expand_width(), 1.)

0 commit comments

Comments
 (0)