🐛 Added some platform checks
This commit is contained in:
@@ -586,6 +586,7 @@ class _UnauthorizedCard extends HookConsumerWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
|
const SizedBox(width: double.infinity),
|
||||||
Icon(
|
Icon(
|
||||||
Symbols.dashboard_rounded,
|
Symbols.dashboard_rounded,
|
||||||
size: 64,
|
size: 64,
|
||||||
|
|||||||
@@ -125,6 +125,8 @@ class WindowScaffold extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
|
if (kIsWeb) return null;
|
||||||
|
|
||||||
hotKeyManager.register(
|
hotKeyManager.register(
|
||||||
popHotKey,
|
popHotKey,
|
||||||
keyDownHandler: (_) {
|
keyDownHandler: (_) {
|
||||||
@@ -632,4 +634,4 @@ class _WebSocketIndicator extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,36 +162,38 @@ class AppWrapper extends HookConsumerWidget {
|
|||||||
(now.day >= 22 && now.day <= 28);
|
(now.day >= 22 && now.day <= 28);
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
final now = DateTime.now();
|
Future(() {
|
||||||
if (doesShowSnow) {
|
final now = DateTime.now();
|
||||||
isShowSnow.value = true;
|
if (doesShowSnow) {
|
||||||
Future.delayed(const Duration(seconds: 60), () {
|
isShowSnow.value = true;
|
||||||
if (!context.mounted) return;
|
Future.delayed(const Duration(seconds: 60), () {
|
||||||
isShowSnow.value = false;
|
|
||||||
Future.delayed(const Duration(seconds: 3), () {
|
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
isSnowGone.value = true;
|
isShowSnow.value = false;
|
||||||
|
Future.delayed(const Duration(seconds: 3), () {
|
||||||
|
if (!context.mounted) return;
|
||||||
|
isSnowGone.value = true;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings.firstLaunchAt == null) {
|
|
||||||
settingsNotifier.setFirstLaunchAt(now.toIso8601String());
|
|
||||||
} else if (!settings.askedReview) {
|
|
||||||
final launchAt = DateTime.parse(settings.firstLaunchAt!);
|
|
||||||
final daysSinceFirstLaunch = now.difference(launchAt).inDays;
|
|
||||||
if (daysSinceFirstLaunch >= 3 &&
|
|
||||||
!kIsWeb &&
|
|
||||||
(Platform.isAndroid || Platform.isIOS || Platform.isMacOS)) {
|
|
||||||
final InAppReview inAppReview = InAppReview.instance;
|
|
||||||
Future(() async {
|
|
||||||
if (await inAppReview.isAvailable()) {
|
|
||||||
inAppReview.requestReview();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
settingsNotifier.setAskedReview(true);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (settings.firstLaunchAt == null) {
|
||||||
|
settingsNotifier.setFirstLaunchAt(now.toIso8601String());
|
||||||
|
} else if (!settings.askedReview) {
|
||||||
|
final launchAt = DateTime.parse(settings.firstLaunchAt!);
|
||||||
|
final daysSinceFirstLaunch = now.difference(launchAt).inDays;
|
||||||
|
if (daysSinceFirstLaunch >= 3 &&
|
||||||
|
!kIsWeb &&
|
||||||
|
(Platform.isAndroid || Platform.isIOS || Platform.isMacOS)) {
|
||||||
|
final InAppReview inAppReview = InAppReview.instance;
|
||||||
|
Future(() async {
|
||||||
|
if (await inAppReview.isAvailable()) {
|
||||||
|
inAppReview.requestReview();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
settingsNotifier.setAskedReview(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class ExtendedRefreshIndicator extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
|
if (kIsWeb) return null;
|
||||||
|
|
||||||
hotKeyManager.register(
|
hotKeyManager.register(
|
||||||
refreshHotKey,
|
refreshHotKey,
|
||||||
keyDownHandler: (_) {
|
keyDownHandler: (_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user