fix macos minisized after checking permission
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
ea12eccc90
commit
ae640dda56
@ -2281,10 +2281,18 @@ void onCopyFingerprint(String value) {
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> callMainCheckSuperUserPermission() async {
|
||||
bool checked = await bind.mainCheckSuperUserPermission();
|
||||
if (Platform.isMacOS) {
|
||||
await windowManager.show();
|
||||
}
|
||||
return checked;
|
||||
}
|
||||
|
||||
Future<void> start_service(bool is_start) async {
|
||||
bool checked = !bind.mainIsInstalled() ||
|
||||
!Platform.isMacOS ||
|
||||
await bind.mainCheckSuperUserPermission();
|
||||
await callMainCheckSuperUserPermission();
|
||||
if (checked) {
|
||||
bind.mainSetOption(key: "stop-service", value: is_start ? "" : "Y");
|
||||
}
|
||||
|
@ -1832,13 +1832,10 @@ Widget _lock(
|
||||
Text(translate(label)).marginOnly(left: 5),
|
||||
]).marginSymmetric(vertical: 2)),
|
||||
onPressed: () async {
|
||||
bool checked = await bind.mainCheckSuperUserPermission();
|
||||
bool checked = await callMainCheckSuperUserPermission();
|
||||
if (checked) {
|
||||
onUnlock();
|
||||
}
|
||||
if (Platform.isMacOS) {
|
||||
await windowManager.show();
|
||||
}
|
||||
},
|
||||
).marginSymmetric(horizontal: 2, vertical: 4),
|
||||
).marginOnly(left: _kCardLeftMargin),
|
||||
|
Loading…
x
Reference in New Issue
Block a user