mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-25 11:13:41 +00:00
Make more code conform to strict null checks (#10219
* Make more code conform to strict null checks * Fix types * Fix tests * Fix remaining test assertions * Iterate PR
This commit is contained in:
committed by
GitHub
parent
4c79ecf141
commit
76b82b4b2b
@@ -20,12 +20,13 @@ import { Room } from "matrix-js-sdk/src/matrix";
|
||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
||||
import { SettingLevel } from "../../settings/SettingLevel";
|
||||
import SettingsStore from "../../settings/SettingsStore";
|
||||
import { filterBoolean } from "../../utils/arrays";
|
||||
|
||||
export const useRecentSearches = (): [Room[], () => void] => {
|
||||
const [rooms, setRooms] = useState(() => {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const recents = SettingsStore.getValue<string[]>("SpotlightSearch.recentSearches", null);
|
||||
return recents.map((r) => cli.getRoom(r)).filter(Boolean) as Room[];
|
||||
return filterBoolean(recents.map((r) => cli.getRoom(r)));
|
||||
});
|
||||
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user