mirror of
https://github.com/recloudstream/website.git
synced 2024-08-15 03:18:45 +00:00
fix build
This commit is contained in:
parent
711823a824
commit
1b2f76b8fa
2 changed files with 6 additions and 2 deletions
|
@ -2,7 +2,9 @@ import { init } from '@noriginmedia/norigin-spatial-navigation';
|
|||
|
||||
require("prism-themes/themes/prism-dracula.min.css")
|
||||
|
||||
if (window !== undefined) {
|
||||
const isBrowser = typeof window !== "undefined"
|
||||
|
||||
if (isBrowser) {
|
||||
init({
|
||||
visualDebug: false
|
||||
});
|
||||
|
|
|
@ -3,6 +3,8 @@ import { useFocusable } from '@noriginmedia/norigin-spatial-navigation';
|
|||
import { Link, navigate } from "gatsby";
|
||||
|
||||
|
||||
const isBrowser = typeof window !== "undefined"
|
||||
|
||||
function CompatBtn({autoFocus, href, onClick, group, target, children, className, ...props}) {
|
||||
const { ref, focused, focusSelf} = useFocusable();
|
||||
|
||||
|
@ -17,7 +19,7 @@ function CompatBtn({autoFocus, href, onClick, group, target, children, className
|
|||
ref.current?.focus()
|
||||
}
|
||||
|
||||
if (window) {
|
||||
if (isBrowser) {
|
||||
window.addEventListener("keyup", (ev) => {
|
||||
if (!focused) return;
|
||||
if (document.activeElement !== ref.current) return;
|
||||
|
|
Loading…
Reference in a new issue