Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jan 8, 2025
1 parent 8cc7af4 commit 1160d3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:async';

import 'package:flutter/foundation.dart';

import 'package:appflowy/plugins/trash/application/trash_listener.dart';
import 'package:appflowy/plugins/trash/application/trash_service.dart';
import 'package:appflowy/workspace/application/command_palette/search_listener.dart';
Expand All @@ -10,6 +8,7 @@ import 'package:appflowy_backend/protobuf/flowy-folder/trash.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-search/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-search/result.pb.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'command_palette_bloc.freezed.dart';
Expand Down Expand Up @@ -90,12 +89,9 @@ class CommandPaletteBloc

_messagesReceived++;

final searchResults = _filterDuplicates(results.items);
searchResults.sort((a, b) => b.score.compareTo(a.score));

emit(
state.copyWith(
results: searchResults,
results: results.items,
isLoading: _messagesReceived != results.sends.toInt(),
),
);
Expand Down
5 changes: 1 addition & 4 deletions frontend/rust-lib/flowy-search/src/document/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ impl SearchHandler for DocumentSearchHandler {
id: result.object_id.clone(),
data: view.name.clone(),
icon,
// We reverse the score, the cloud search score is based on
// 1 being the worst result, and closer to 0 being good result, that is
// the opposite of local search.
score: 1.0 - result.score,
score: result.score,
workspace_id: result.workspace_id,
preview: result.preview,
});
Expand Down

0 comments on commit 1160d3d

Please sign in to comment.