Skip to content

Commit 8249927

Browse files
committed
autocomplete: Use topic data from store in topic autocomplete
1 parent 4705c95 commit 8249927

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/model/autocomplete.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:unorm_dart/unorm_dart.dart' as unorm;
66

77
import '../api/model/events.dart';
88
import '../api/model/model.dart';
9-
import '../api/route/channels.dart';
109
import '../generated/l10n/zulip_localizations.dart';
1110
import '../widgets/compose_box.dart';
1211
import 'algorithms.dart';
@@ -1175,10 +1174,8 @@ class TopicAutocompleteView extends AutocompleteView<TopicAutocompleteQuery, Top
11751174
Future<void> _fetch() async {
11761175
assert(!_isFetching);
11771176
_isFetching = true;
1178-
final result = await getStreamTopics(store.connection, streamId: streamId,
1179-
allowEmptyTopicName: true,
1180-
);
1181-
_topics = result.topics.map((e) => e.name);
1177+
await store.fetchTopics(streamId);
1178+
_topics = store.getChannelTopics(streamId)!.map((e) => e.name);
11821179
_isFetching = false;
11831180
return _startSearch();
11841181
}

0 commit comments

Comments
 (0)