File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ export default function ViewPage() {
134134 }
135135 } , [ ] ) ;
136136
137+ /*
137138 useEffect(() => {
138139 console.log("via useEffect");
139140 if (imageRef.current?.complete) {
@@ -144,7 +145,7 @@ export default function ViewPage() {
144145 }
145146 }
146147 }, [onImageError, onImageLoad, onSizeZero]);
147-
148+ */
148149 useEffect ( ( ) => {
149150 function handleResize ( ) {
150151 console . log ( `resize: ${ window ?. innerWidth } x${ window ?. innerHeight } ` ) ;
@@ -205,8 +206,12 @@ export default function ViewPage() {
205206 onImageError ( evt ) ;
206207 } }
207208 onLoad = { ( ) => {
208- onImageLoad ( ) ;
209209 console . log ( "via onLoad" ) ;
210+ if ( imageRef . current ?. naturalWidth === 0 ) {
211+ onSizeZero ( ) ;
212+ } else {
213+ onImageLoad ( ) ;
214+ }
210215 } }
211216 ref = { imageRef }
212217 src = { url }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # run locally for dev
4+ #
5+
6+ set -o errexit
7+ set -o pipefail
8+ set -o nounset
9+
10+ #
11+ # load an .env file if it exists
12+ #
13+ ENV_FILE=" ${1:- ./ .env} "
14+ if [ -f " ${ENV_FILE} " ]; then
15+ echo " INFO: loading '${ENV_FILE} '!"
16+ export $( cat " ${ENV_FILE} " )
17+ fi
18+
19+ if [ ! -d " node_modules" ]; then
20+ echo " INFO: installing node modules!"
21+ npm install
22+ fi
23+
24+ #
25+ # build
26+ #
27+ npm run build
28+
29+ cd ./build/client
30+
31+ python3 -m http.server 4000
You can’t perform that action at this time.
0 commit comments