From b2fe05a4c4a97cc5db9f329667a61c0d97dc9f8d Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Wed, 27 Jul 2022 01:19:25 -0400 Subject: [PATCH] Fix stream info not refreshing --- lib/models/emotes.g.dart | 2 +- lib/screens/channel/stores/chat_store.g.dart | 8 ++++++++ lib/screens/channel/stores/video_store.dart | 2 ++ lib/screens/channel/stores/video_store.g.dart | 11 +++++++++++ lib/screens/settings/stores/settings_store.g.dart | 4 ++-- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/models/emotes.g.dart b/lib/models/emotes.g.dart index 9cc8e12b..f2f330dc 100644 --- a/lib/models/emotes.g.dart +++ b/lib/models/emotes.g.dart @@ -140,7 +140,7 @@ Map _$EmoteToJson(Emote instance) => { 'height': instance.height, 'zeroWidth': instance.zeroWidth, 'url': instance.url, - 'type': _$EmoteTypeEnumMap[instance.type], + 'type': _$EmoteTypeEnumMap[instance.type]!, 'ownerId': instance.ownerId, }; diff --git a/lib/screens/channel/stores/chat_store.g.dart b/lib/screens/channel/stores/chat_store.g.dart index a2f3f2b1..dcf97348 100644 --- a/lib/screens/channel/stores/chat_store.g.dart +++ b/lib/screens/channel/stores/chat_store.g.dart @@ -135,6 +135,14 @@ mixin _$ChatStore on ChatStoreBase, Store { }); } + late final _$getAssetsAsyncAction = + AsyncAction('ChatStoreBase.getAssets', context: context); + + @override + Future getAssets() { + return _$getAssetsAsyncAction.run(() => super.getAssets()); + } + late final _$ChatStoreBaseActionController = ActionController(name: 'ChatStoreBase', context: context); diff --git a/lib/screens/channel/stores/video_store.dart b/lib/screens/channel/stores/video_store.dart index fb093333..c6b349a9 100644 --- a/lib/screens/channel/stores/video_store.dart +++ b/lib/screens/channel/stores/video_store.dart @@ -147,9 +147,11 @@ abstract class VideoStoreBase with Store { } } + @action void handleRefresh() { HapticFeedback.lightImpact(); controller?.reload(); + updateStreamInfo(); } FutureOr handleNavigation(NavigationRequest navigation) { diff --git a/lib/screens/channel/stores/video_store.g.dart b/lib/screens/channel/stores/video_store.g.dart index 914038ce..bcd5bebd 100644 --- a/lib/screens/channel/stores/video_store.g.dart +++ b/lib/screens/channel/stores/video_store.g.dart @@ -198,6 +198,17 @@ mixin _$VideoStore on VideoStoreBase, Store { } } + @override + void handleRefresh() { + final _$actionInfo = _$VideoStoreBaseActionController.startAction( + name: 'VideoStoreBase.handleRefresh'); + try { + return super.handleRefresh(); + } finally { + _$VideoStoreBaseActionController.endAction(_$actionInfo); + } + } + @override String toString() { return ''' diff --git a/lib/screens/settings/stores/settings_store.g.dart b/lib/screens/settings/stores/settings_store.g.dart index c92b38db..54e4b839 100644 --- a/lib/screens/settings/stores/settings_store.g.dart +++ b/lib/screens/settings/stores/settings_store.g.dart @@ -48,7 +48,7 @@ SettingsStore _$SettingsStoreFromJson(Map json) => Map _$SettingsStoreToJson(SettingsStore instance) => { - 'themeType': _$ThemeTypeEnumMap[instance.themeType], + 'themeType': _$ThemeTypeEnumMap[instance.themeType]!, 'showThumbnails': instance.showThumbnails, 'largeStreamCard': instance.largeStreamCard, 'showThumbnailUptime': instance.showThumbnailUptime, @@ -68,7 +68,7 @@ Map _$SettingsStoreToJson(SettingsStore instance) => 'useReadableColors': instance.useReadableColors, 'showDeletedMessages': instance.showDeletedMessages, 'showChatMessageDividers': instance.showChatMessageDividers, - 'timestampType': _$TimestampTypeEnumMap[instance.timestampType], + 'timestampType': _$TimestampTypeEnumMap[instance.timestampType]!, 'badgeScale': instance.badgeScale, 'emoteScale': instance.emoteScale, 'messageScale': instance.messageScale,