mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +00:00
chore: Follow up design fixes
This commit is contained in:
parent
709e8c61af
commit
050d2a2fae
2 changed files with 19 additions and 11 deletions
|
@ -1178,6 +1178,12 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
static const Duration _storeInputTimeout = Duration(milliseconds: 500);
|
static const Duration _storeInputTimeout = Duration(milliseconds: 500);
|
||||||
|
|
||||||
void onInputBarChanged(String text) {
|
void onInputBarChanged(String text) {
|
||||||
|
if (_inputTextIsEmpty != text.isEmpty) {
|
||||||
|
setState(() {
|
||||||
|
_inputTextIsEmpty = text.isEmpty;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_storeInputTimeoutTimer?.cancel();
|
_storeInputTimeoutTimer?.cancel();
|
||||||
_storeInputTimeoutTimer = Timer(_storeInputTimeout, () async {
|
_storeInputTimeoutTimer = Timer(_storeInputTimeout, () async {
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
@ -1216,11 +1222,6 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_inputTextIsEmpty != text.isEmpty) {
|
|
||||||
setState(() {
|
|
||||||
_inputTextIsEmpty = text.isEmpty;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _inputTextIsEmpty = true;
|
bool _inputTextIsEmpty = true;
|
||||||
|
|
|
@ -50,6 +50,10 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
|
|
||||||
Future<GetSpaceHierarchyResponse> loadHierarchy([String? prevBatch]) async {
|
Future<GetSpaceHierarchyResponse> loadHierarchy([String? prevBatch]) async {
|
||||||
final activeSpaceId = widget.controller.activeSpaceId!;
|
final activeSpaceId = widget.controller.activeSpaceId!;
|
||||||
|
final client = Matrix.of(context).client;
|
||||||
|
|
||||||
|
final activeSpace = client.getRoomById(activeSpaceId);
|
||||||
|
await activeSpace?.postLoad();
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
error = null;
|
error = null;
|
||||||
|
@ -57,7 +61,7 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final response = await Matrix.of(context).client.getSpaceHierarchy(
|
final response = await client.getSpaceHierarchy(
|
||||||
activeSpaceId,
|
activeSpaceId,
|
||||||
maxDepth: 1,
|
maxDepth: 1,
|
||||||
from: prevBatch,
|
from: prevBatch,
|
||||||
|
@ -139,7 +143,8 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
label: L10n.of(context)!.joinRoom,
|
label: L10n.of(context)!.joinRoom,
|
||||||
icon: Icons.send_outlined,
|
icon: Icons.send_outlined,
|
||||||
),
|
),
|
||||||
if (spaceChild != null && (activeSpace?.canSendDefaultStates ?? false))
|
if (spaceChild != null &&
|
||||||
|
(activeSpace?.canChangeStateEvent(EventTypes.spaceChild) ?? false))
|
||||||
SheetAction(
|
SheetAction(
|
||||||
key: SpaceChildContextAction.removeFromSpace,
|
key: SpaceChildContextAction.removeFromSpace,
|
||||||
label: L10n.of(context)!.removeFromSpace,
|
label: L10n.of(context)!.removeFromSpace,
|
||||||
|
@ -338,6 +343,8 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
slivers: [
|
slivers: [
|
||||||
ChatListHeader(controller: widget.controller),
|
ChatListHeader(controller: widget.controller),
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
primary: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
title: ListTile(
|
title: ListTile(
|
||||||
leading: BackButton(
|
leading: BackButton(
|
||||||
|
|
Loading…
Reference in a new issue