Skip to content

Commit

Permalink
fix: minor changes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazin committed Apr 4, 2024
1 parent 5f2e3f4 commit 9be7d36
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';

import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-notification/protobuf.dart';
Expand All @@ -9,6 +10,9 @@ import 'package:appflowy_result/appflowy_result.dart';

import 'notification_helper.dart';

// This value must be identical to the value in the backend (SEARCH_OBSERVABLE_SOURCE)
const _source = 'Search';

typedef SearchNotificationCallback = void Function(
SearchNotification,
FlowyResult<Uint8List, FlowyError>,
Expand All @@ -20,7 +24,8 @@ class SearchNotificationParser
super.id,
required super.callback,
}) : super(
tyParser: (ty) => SearchNotification.valueOf(ty),
tyParser: (ty, source) =>
source == _source ? SearchNotification.valueOf(ty) : null,
errorParser: (bytes) => FlowyError.fromBuffer(bytes),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class CommandPaletteBloc
);

_initTrash();

_dispatch();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'dart:io';

import 'package:flutter/material.dart';

import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/workspace/application/home/home_setting_bloc.dart';
import 'package:appflowy/workspace/application/settings/appearance/appearance_cubit.dart';
import 'package:appflowy/workspace/application/sidebar/rename_view/rename_view_bloc.dart';
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/sidebar_setting.dart';
import 'package:flutter/material.dart';
import 'package:hotkey_manager/hotkey_manager.dart';
import 'package:provider/provider.dart';

Expand Down
24 changes: 11 additions & 13 deletions frontend/rust-lib/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/rust-lib/flowy-document/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::entities::{
};
use crate::notification::{send_notification, DocumentNotification};
use collab::core::collab::MutexCollab;
use collab_document::document::DocumentIndexContent;
use collab_document::{blocks::DocumentData, document::Document};
use flowy_error::FlowyResult;
use futures::StreamExt;
Expand Down
4 changes: 2 additions & 2 deletions frontend/rust-lib/flowy-search/src/services/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tokio::sync::broadcast;

use crate::entities::{SearchNotification, SearchResultNotificationPB};

const OBSERVABLE_SOURCE: &str = "SEARCH";
const SEARCH_OBSERVABLE_SOURCE: &str = "Search";
const SEARCH_ID: &str = "SEARCH_IDENTIFIER";

#[derive(Clone)]
Expand Down Expand Up @@ -49,5 +49,5 @@ impl SearchResultReceiverRunner {

#[tracing::instrument(level = "trace")]
pub fn send_notification(id: &str, ty: SearchNotification) -> NotificationBuilder {
NotificationBuilder::new(id, ty, OBSERVABLE_SOURCE)
NotificationBuilder::new(id, ty, SEARCH_OBSERVABLE_SOURCE)
}

0 comments on commit 9be7d36

Please sign in to comment.