fix(meta): Fix fresh/migrated version hickups

This commit is contained in:
PapaTutuWawa 2023-01-02 21:11:49 +01:00
parent 6f1493808f
commit 9f8f3a5407
4 changed files with 7 additions and 5 deletions

View File

@ -59,7 +59,7 @@ Future<void> createDatabase(Database db, int version) async {
stickerHashKey TEXT,
pseudoMessageType INTEGER,
pseudoMessageData TEXT,
CONSTRAINT fk_quote FOREIGN KEY (quote_id) REFERENCES $messagesTable (id),
CONSTRAINT fk_quote FOREIGN KEY (quote_id) REFERENCES $messagesTable (id)
)''',
);

View File

@ -252,6 +252,7 @@ Future<void> entrypoint() async {
sendEvent(ServiceReadyEvent());
}
@pragma('vm:entry-point')
Future<void> receiveUIEvent(Map<String, dynamic>? data) async {
await GetIt.I.get<SynchronizedQueue<Map<String, dynamic>?>>().add(data);
}

View File

@ -6,9 +6,8 @@ abstract class PreferencesEvent {}
/// If [notify] is true, then the background service will be
/// notified of this change.
class PreferencesChangedEvent extends PreferencesEvent {
PreferencesChangedEvent(this.preferences, {
this.notify = true,
this.notify = true,
});
final PreferencesState preferences;
final bool notify;
@ -19,7 +18,6 @@ class SignedOutEvent extends PreferencesEvent {}
/// Triggered when a background image has been set
class BackgroundImageSetEvent extends PreferencesEvent {
BackgroundImageSetEvent(this.backgroundPath);
final String backgroundPath;
}

View File

@ -17,7 +17,10 @@ import 'package:share_handler/share_handler.dart';
/// Handler for when we received a [PreStartDoneEvent].
Future<void> preStartDone(PreStartDoneEvent result, { dynamic extra }) async {
GetIt.I.get<PreferencesBloc>().add(
PreferencesChangedEvent(result.preferences),
PreferencesChangedEvent(
result.preferences,
notify: false,
),
);
WidgetsFlutterBinding.ensureInitialized();