mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
Fix logic
This commit is contained in:
parent
4cbabdcc39
commit
e832ba57fe
@ -87,12 +87,14 @@ export default function SearchDetailDialog({
|
||||
}, [config, search]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!searchTabs.includes(page)) {
|
||||
if (searchTabs.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!searchTabs.includes(pageToggle)) {
|
||||
setPage("details");
|
||||
}
|
||||
// we know that these deps are correct
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [searchTabs]);
|
||||
}, [pageToggle, searchTabs]);
|
||||
|
||||
if (!search) {
|
||||
return;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import copy from "copy-to-clipboard";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export function shareOrCopy(url: string, title?: string) {
|
||||
if (window.isSecureContext && "share" in navigator) {
|
||||
@ -8,5 +9,8 @@ export function shareOrCopy(url: string, title?: string) {
|
||||
});
|
||||
} else {
|
||||
copy(url);
|
||||
toast.success("Copied to clipboard.", {
|
||||
position: "top-center",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user