This repository was archived by the owner on Aug 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +23
-16
lines changed
Expand file tree Collapse file tree 6 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import JsBarcode from "jsbarcode";
22import { chakra } from "@chakra-ui/react" ;
33
44export default ( { value } : { value : string } ) => {
5- const barcodeCallback = ( el : Element ) => {
5+ const barcodeCallback = ( el : Element | null ) => {
66 if ( el ) {
77 JsBarcode ( el , value ) ;
88 }
Original file line number Diff line number Diff line change @@ -40,9 +40,11 @@ export const DTTPeriod = ({
4040 leftContent = { period . name }
4141 leftContentSize = { "xs" }
4242 transition = {
43- period ?. name === "Transition" ||
44- DateTime . fromISO ( `${ period ?. date } T15:15` ) <= period . time ||
45- period . time <= DateTime . fromISO ( `${ period ?. date } T09:00` )
43+ period ?. time
44+ ? period ?. name === "Transition" ||
45+ DateTime . fromISO ( `${ period ?. date } T15:15` ) <= period ?. time ||
46+ period ?. time <= DateTime . fromISO ( `${ period ?. date } T09:00` )
47+ : true
4648 }
4749 isLoaded = { isLoaded }
4850 rightContent = {
Original file line number Diff line number Diff line change 77} from "../../stores/auth" ;
88
99const InstallButton = ( ) => {
10- const deferredPrompt = useRef < BeforeInstallPromptEvent > ( null ) ;
10+ const deferredPrompt = useRef < BeforeInstallPromptEvent | null > ( null ) ;
1111 const [ showInstall , setShowInstall ] = useState ( false ) ;
1212
1313 window . addEventListener (
@@ -30,8 +30,8 @@ const InstallButton = () => {
3030 < Button
3131 mr = { 1 }
3232 onClick = { async ( ) => {
33- deferredPrompt . current . prompt ( ) ;
34- await deferredPrompt . current . userChoice ;
33+ deferredPrompt . current ? .prompt ( ) ;
34+ await deferredPrompt . current ? .userChoice ;
3535 deferredPrompt . current = null ;
3636 setShowInstall ( false ) ;
3737 } }
Original file line number Diff line number Diff line change @@ -8,13 +8,10 @@ export default () => {
88 const isFetching = useIsFetching ( ) ;
99 const [ online , setOnline ] = useState ( true ) ;
1010
11- document . addEventListener (
12- "onlinechange" ,
13- ( { detail : { online } } : CustomEvent < { online : boolean } > ) => {
14- log ( `Online status change detected - Online: ${ online } ` ) ;
15- return setOnline ( online ) ;
16- }
17- ) ;
11+ document . addEventListener ( "onlinechange" , ( { detail : { online } } ) => {
12+ log ( `Online status change detected - Online: ${ online } ` ) ;
13+ return setOnline ( online ) ;
14+ } ) ;
1815
1916 return (
2017 < Flex p = { 2 } rounded = "full" align = { "center" } gap = { 3 } >
Original file line number Diff line number Diff line change @@ -29,3 +29,11 @@ interface BeforeInstallPromptEvent extends Event {
2929 */
3030 prompt ( ) : Promise < void > ;
3131}
32+
33+ interface WindowEventMap {
34+ beforeinstallprompt : BeforeInstallPromptEvent ;
35+ }
36+
37+ interface DocumentEventMap {
38+ onlinechange : CustomEvent < { online : boolean } > ;
39+ }
You can’t perform that action at this time.
0 commit comments