Skip to content

Commit 7ad3431

Browse files
committed
app upgrade
1 parent 1fffef4 commit 7ad3431

File tree

1 file changed

+6
-5
lines changed
  • modules/basic_system/app_update/lib/bloc

1 file changed

+6
-5
lines changed

modules/basic_system/app_update/lib/bloc/bloc.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,19 @@ class UpgradeBloc extends Bloc<UpdateEvent, UpdateState> {
4646
void _onDownloadEvent(DownloadEvent event, Emitter<UpdateState> emit) async {
4747
UpdateState curState = state;
4848
if (curState is! ShouldUpdateState) return;
49+
String url = event.appInfo.url;
50+
51+
if(kAppEnv.isMacOS){
52+
launchUrl(Uri.parse(url));
53+
return;
54+
}
4955

5056
void onProgressChange(double progress) {
5157
add(ProgressChangeEvent(progress: progress));
5258
}
5359

5460
onProgressChange(0.001);
5561

56-
String url = event.appInfo.url;
5762
if (kIsDesk) {
5863
handleDesk(url, onProgressChange);
5964
return;
@@ -62,10 +67,6 @@ class UpgradeBloc extends Bloc<UpdateEvent, UpdateState> {
6267
}
6368

6469
void handleDesk(String url, OnProgressChange callback) async {
65-
if(kAppEnv.isMacOS){
66-
launchUrl(Uri.parse(url));
67-
return;
68-
}
6970
Dio dio = Dio();
7071
Directory dir = await getTemporaryDirectory();
7172
String filePath = p.join(dir.path, p.basename(url));

0 commit comments

Comments
 (0)