Skip to content

Commit

Permalink
Merge pull request #28 from Muska-Ami/dev
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
Muska-Ami authored Jan 12, 2024
2 parents d4f3ae0 + 78b6dd2 commit b8d1cb3
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 30 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ name: Build

on:
push:
branches: [ "main" ]
branches:
- main
- dev

jobs:
build-windows:
Expand All @@ -31,11 +33,6 @@ jobs:
with:
name: Windows Artifact(Build)
path: build

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
dist-windows:
needs:
- build-windows
Expand Down Expand Up @@ -90,11 +87,6 @@ jobs:
with:
name: Linux Artifact(Build)
path: build

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
dist-linux-appimage:
needs:
- build-linux
Expand Down Expand Up @@ -205,11 +197,6 @@ jobs:
with:
name: MacOS Artifact(Build)
path: build

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
dist-macos:
needs:
- build-macos
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ An unoffical LoCyanFrp launcher.
- [ ] 隧道编辑
- [x] 公告
- [x] 通知
- [ ] 暗色主题
- [x] 暗色主题

## Repo stats

Expand Down
4 changes: 3 additions & 1 deletion lib/controller/dsettingfrpc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class DSettingFrpcController extends GetxController {
'下载取消',
style: TextStyle(color: Colors.orange),
));
frpc_download_cancel = false;
downloadCancelToken = new CancelToken();
} else {
frpc_download_show.clear();
frpc_download_show.add(LinearProgressIndicator(
Expand Down Expand Up @@ -201,7 +203,7 @@ class DSettingFrpcController extends GetxController {
);
}

final downloadCancelToken = CancelToken();
CancelToken downloadCancelToken = CancelToken();

void downloadFrpcCallback(received, total) {
print('Download callback: ${received}');
Expand Down
8 changes: 7 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:get/get.dart';
import 'package:flutter/services.dart';
import 'package:nyalcf/controller/user.dart';
import 'package:nyalcf/io/frpcManagerStorage.dart';
import 'package:nyalcf/io/settingStorage.dart';
Expand All @@ -26,6 +27,7 @@ void main() async {
runApp(const App());

doWhenWindowReady(() {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
const initialSize = Size(800, 500);
appWindow.minSize = initialSize;
appWindow.size = initialSize;
Expand Down Expand Up @@ -64,7 +66,11 @@ class App extends StatelessWidget {
/// 判定是否需要切换暗色主题
if (((_settings?.theme_auto ?? true) && isDarkMode) ||
(_settings?.theme_dark ?? false)) {
_theme_data = ThemeData.dark(useMaterial3: true);
_theme_data = ThemeData(
useMaterial3: true,
fontFamily: 'HarmonyOS Sans',
brightness: Brightness.dark,
);
} else if ((_settings?.theme_light_seed_enable ?? false)) {
_theme_data = ThemeData(
useMaterial3: true,
Expand Down
2 changes: 2 additions & 0 deletions lib/ui/model/FrpcDownloadDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class FrpcDownloadDialogX {
)),
ElevatedButton(
onPressed: () async {
/// 刷新一下UI
ds_c.refreshDownloadShow();
/// 开始下载
Get.dialog(_downloading(), barrierDismissible: false);
final res = await FrpcDownloadDio().download(
Expand Down
6 changes: 2 additions & 4 deletions lib/util/FileIO.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class FileIO {
* 获取缓存目录
*/
static Future<String> get cache_path async {
String path = '';
await _cache_path.then((value) => path = value.path);
String path = (await _cache_path).path;
print('Get cache path $path');
return path;
}
Expand All @@ -20,8 +19,7 @@ class FileIO {
* 获取数据存储目录
*/
static Future<String> get support_path async {
String path = '';
await _support_path.then((value) => path = value.path);
String path = (await _support_path).path;
print('Get support path: $path');
return path;
}
Expand Down
6 changes: 3 additions & 3 deletions macos/Runner/DebugProfile.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.files.uses-selected.read-write</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<key>com.apple.security.filesystem.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
Expand Down
6 changes: 3 additions & 3 deletions macos/Runner/Release.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.uses-selected.read-write</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<key>com.apple.security.filesystem.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.1.0
version: 0.1.1

environment:
sdk: '>=3.1.5 <4.0.0'
Expand Down

0 comments on commit b8d1cb3

Please sign in to comment.