mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
Merge branch 'krille/pinned-events-high' into 'main'
fix: Hide pinned events if event is not accessable or loading See merge request famedly/fluffychat!800
This commit is contained in:
commit
fd248aad53
@ -60,9 +60,11 @@ class PinnedEvents extends StatelessWidget {
|
|||||||
? snapshot.data?.last
|
? snapshot.data?.last
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (event != null && pinnedEvents != null) {
|
if (event == null || pinnedEvents == null) {
|
||||||
final fontSize =
|
return Container();
|
||||||
AppConfig.messageFontSize * AppConfig.fontSizeFactor;
|
}
|
||||||
|
|
||||||
|
final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor;
|
||||||
return Material(
|
return Material(
|
||||||
color: Theme.of(context).appBarTheme.backgroundColor,
|
color: Theme.of(context).appBarTheme.backgroundColor,
|
||||||
elevation: Theme.of(context).appBarTheme.elevation ?? 10,
|
elevation: Theme.of(context).appBarTheme.elevation ?? 10,
|
||||||
@ -120,22 +122,6 @@ class PinnedEvents extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (snapshot.hasError) {
|
|
||||||
Logs().e('Error loading pinned events.', snapshot.error);
|
|
||||||
return ListTile(
|
|
||||||
tileColor: Theme.of(context).secondaryHeaderColor,
|
|
||||||
title: Text(L10n.of(context)!.pinnedEventsError));
|
|
||||||
} else {
|
|
||||||
return ListTile(
|
|
||||||
tileColor: Theme.of(context).secondaryHeaderColor,
|
|
||||||
title: const Center(
|
|
||||||
child: SizedBox.square(
|
|
||||||
dimension: 24,
|
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user