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