Skip to content

Commit

Permalink
longer controller search wait. Missing back button on box feed
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaminwater committed May 13, 2021
1 parent 4f83e7d commit f92ce55
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/pages/add_device/device_wifi/device_wifi_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ class DeviceWifiBloc extends Bloc<DeviceWifiBlocEvent, DeviceWifiBlocState> {
var ddb = RelDB.get().devicesDAO;
Device device = await ddb.getDevice(args.device.id);

yield DeviceWifiBlocStateSearching(1, 5);
yield DeviceWifiBlocStateSearching(1, 10);
await RelDB.get().devicesDAO.updateDevice(DevicesCompanion(id: Value(device.id), isReachable: Value(false)));

String ip;
for (int i = 0; i < 5; ++i) {
yield DeviceWifiBlocStateSearching(i + 1, 5);
await new Future.delayed(const Duration(seconds: 3));
for (int i = 0; i < 10; ++i) {
yield DeviceWifiBlocStateSearching(i + 1, 10);
await new Future.delayed(const Duration(seconds: 5));
ip = await DeviceAPI.resolveLocalName(device.mdns);
if (ip == "" || ip == null) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class _LocalBoxFeedPageState extends State<LocalBoxFeedPage> {
key: Key('feed'),
create: (context) => FeedBloc(LocalBoxFeedBlocDelegate(state.box.feed)),
child: FeedPage(
automaticallyImplyLeading: true,
color: Color(0xff063047),
actions: actions,
bottomPadding: true,
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/settings/auth/login/settings_login_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class SettingsLoginBlocEventInit extends SettingsLoginBlocEvent {
List<Object> get props => [];
}

class SettingsLoginBlocEventCreateAccount extends SettingsLoginBlocEvent {
class SettingsLoginBlocEventLogin extends SettingsLoginBlocEvent {
final String nickname;
final String password;

SettingsLoginBlocEventCreateAccount(this.nickname, this.password);
SettingsLoginBlocEventLogin(this.nickname, this.password);

@override
List<Object> get props => [nickname, password];
Expand Down Expand Up @@ -68,7 +68,7 @@ class SettingsLoginBloc extends Bloc<SettingsLoginBlocEvent, SettingsLoginBlocSt
if (event is SettingsLoginBlocEventInit) {
yield SettingsLoginBlocStateLoading();
yield SettingsLoginBlocStateLoaded(_isAuth);
} else if (event is SettingsLoginBlocEventCreateAccount) {
} else if (event is SettingsLoginBlocEventLogin) {
yield SettingsLoginBlocStateLoading();
try {
await BackendAPI().usersAPI.login(event.nickname, event.password);
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings/auth/login/settings_login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class _SettingsLoginPageState extends State<SettingsLoginPage> {

void _handleInput(BuildContext context) {
BlocProvider.of<SettingsLoginBloc>(context)
.add(SettingsLoginBlocEventCreateAccount(_nicknameController.value.text, _passwordController.value.text));
.add(SettingsLoginBlocEventLogin(_nicknameController.value.text, _passwordController.value.text));
}

@override
Expand Down

0 comments on commit f92ce55

Please sign in to comment.