Skip to content

Commit

Permalink
Delay init and make FWInfo const
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Jun 13, 2024
1 parent 864c967 commit 6916b98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/Backend/app_shortcuts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const QuickActions quickActions = QuickActions();

@Riverpod(keepAlive: true)
Future<void> appShortcuts(AppShortcutsRef ref) async {
await Future.delayed(const Duration(seconds: 5));
quickActions.initialize((shortcutType) {
BaseAction? action = ref.read(getActionFromUUIDProvider(shortcutType));
if (action != null) {
Expand Down
13 changes: 3 additions & 10 deletions lib/Backend/firmware_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@ part 'firmware_update.g.dart';

@freezed
class FWInfo with _$FWInfo {
FWInfo._();

factory FWInfo({
const factory FWInfo({
required String version,
required String md5sum,
required String url,
@Default("") String changelog,
@Default("") String glash,
@Default("") final String changelog,
@Default("") final String glash,
}) = _FWInfo;

factory FWInfo.fromJson(Map<String, dynamic> json) => _$FWInfoFromJson(json);

@override
String toString() {
return 'FWInfo{version: $version}';
}
}
1 change: 1 addition & 0 deletions lib/Backend/wear_bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ StreamSubscription<CapabilityInfo>? capabilityChangedStreamSubscription;

@Riverpod(keepAlive: true)
Future<void> initWear(InitWearRef ref) async {
await Future.delayed(const Duration(seconds: 5));
try {
if (!Platform.isAndroid || !await _flutterWearOsConnectivity.isSupported()) {
return;
Expand Down

0 comments on commit 6916b98

Please sign in to comment.