mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: Tentative fix for windowsize missing plugin exception (#2544)
This commit is contained in:
@@ -9,6 +9,9 @@ Future<void> setDefaultMinimumWindowSize() async {
|
||||
if (!Platform.isMacOS) return;
|
||||
|
||||
try {
|
||||
// A small delay to confirm that our native platform channels are ready
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
final result = await _channel.invokeMethod(
|
||||
'setMinWindowSize',
|
||||
{'width': 500, 'height': 700},
|
||||
@@ -19,5 +22,21 @@ Future<void> setDefaultMinimumWindowSize() async {
|
||||
}
|
||||
} on PlatformException catch (e) {
|
||||
printV("Failed to set minimum window size: '${e.message}'.");
|
||||
} on MissingPluginException catch (e) {
|
||||
printV("Native utils plugin not available yet: '${e.message}'. Retrying...");
|
||||
// We give it a longer delay this time around, and then retry
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
try {
|
||||
final result = await _channel.invokeMethod(
|
||||
'setMinWindowSize',
|
||||
{'width': 500, 'height': 700},
|
||||
) as bool;
|
||||
|
||||
if (!result) {
|
||||
printV("Failed to set minimum window size on retry.");
|
||||
}
|
||||
} catch (retryError) {
|
||||
printV("Failed to set minimum window size after retry: '$retryError'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user