Fix convo bubbles not working and getting intent when closed not working

This commit is contained in:
Tanay Neotia
2022-11-29 19:12:16 -05:00
parent 1b9ba6641e
commit 3b1e60da5c
4 changed files with 12 additions and 3 deletions

View File

@ -40,7 +40,11 @@ class CupertinoHeader extends StatelessWidget implements PreferredSizeWidget {
if (ss.settings.showConnectionIndicator.value)
const ConnectionIndicator(),
Padding(
padding: EdgeInsets.only(left: 20.0, right: 20, top: kIsDesktop ? 0 : MediaQuery.of(context).viewPadding.top - 2),
padding: EdgeInsets.only(
left: 20.0,
right: 20,
top: kIsDesktop ? 0 : (MediaQuery.of(context).viewPadding.top - 2).clamp(0, double.infinity)
),
child: Stack(
alignment: Alignment.center,
children: [

View File

@ -52,6 +52,7 @@ late final Box<ThemeStruct> themeBox;
late final Box<ThemeEntry> themeEntryBox;
late final Box<ThemeObject> themeObjectBox;
final Completer<void> storeStartup = Completer();
final Completer<void> uiStartup = Completer();
@pragma('vm:entry-point')
//ignore: prefer_void_to_null
@ -69,7 +70,7 @@ Future<Null> bubble() async {
Future<Null> initApp(bool bubble) async {
WidgetsFlutterBinding.ensureInitialized();
/* ----- SERVICES INITIALIZATION ----- */
ls.isBubble = false;
ls.isBubble = bubble;
ls.isUiThread = true;
await ss.init();
await fs.init();
@ -521,6 +522,7 @@ class _HomeState extends OptimizedState<Home> with WidgetsBindingObserver {
});
SchedulerBinding.instance.addPostFrameCallback((_) async {
uiStartup.complete();
/* ----- SERVER VERSION CHECK ----- */
if (kIsWeb && ss.settings.finishedSetup.value) {
int version = (await ss.getServerDetails()).item4;

View File

@ -587,7 +587,7 @@ class Chat {
save(updateHasUnreadMessage: true);
try {
if (clearLocalNotifications && !hasUnread) {
if (clearLocalNotifications && !hasUnread && !ls.isBubble) {
mcs.invokeMethod("clear-chat-notifs", {"chatGuid": guid});
}
if (privateMark && ss.settings.enablePrivateAPI.value && ss.settings.privateMarkChatAsRead.value) {

View File

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:bluebubbles/main.dart';
import 'package:bluebubbles/utils/logger.dart';
import 'package:bluebubbles/helpers/helpers.dart';
import 'package:bluebubbles/app/layouts/chat_creator/chat_creator.dart';
@ -83,6 +84,7 @@ class IntentsService extends GetxService {
Future<void> openChat(String? guid, {String? text, List<PlatformFile> attachments = const []}) async {
if (guid == null) {
await uiStartup.future;
ns.pushAndRemoveUntil(
Get.context!,
ChatCreator(
@ -128,6 +130,7 @@ class IntentsService extends GetxService {
}
if (!chatIsOpen) {
await uiStartup.future;
ns.pushAndRemoveUntil(
Get.context!,
ConversationView(