mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-30 02:53:04 +00:00
Apply prettier formatting
This commit is contained in:
@@ -18,11 +18,7 @@ import { useEffect } from "react";
|
||||
|
||||
const DEBOUNCE_TIMEOUT = 100;
|
||||
|
||||
export function useDebouncedCallback<T extends any[]>(
|
||||
enabled: boolean,
|
||||
callback: (...params: T) => void,
|
||||
params: T,
|
||||
) {
|
||||
export function useDebouncedCallback<T extends any[]>(enabled: boolean, callback: (...params: T) => void, params: T) {
|
||||
useEffect(() => {
|
||||
let handle: number | null = null;
|
||||
const doSearch = () => {
|
||||
|
||||
@@ -25,11 +25,14 @@ export const useRecentSearches = (): [Room[], () => void] => {
|
||||
const [rooms, setRooms] = useState(() => {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const recents = SettingsStore.getValue("SpotlightSearch.recentSearches", null);
|
||||
return recents.map(r => cli.getRoom(r)).filter(Boolean);
|
||||
return recents.map((r) => cli.getRoom(r)).filter(Boolean);
|
||||
});
|
||||
|
||||
return [rooms, () => {
|
||||
SettingsStore.setValue("SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, []);
|
||||
setRooms([]);
|
||||
}];
|
||||
return [
|
||||
rooms,
|
||||
() => {
|
||||
SettingsStore.setValue("SpotlightSearch.recentSearches", null, SettingLevel.ACCOUNT, []);
|
||||
setRooms([]);
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user