diff --git a/app/src/hooks/customHooks.js b/app/src/hooks/customHooks.js index 3b32020f..2123ec16 100644 --- a/app/src/hooks/customHooks.js +++ b/app/src/hooks/customHooks.js @@ -67,9 +67,11 @@ export const useLatestRequest = (delay = 300) => { // A hook which ignores older requests and will only set `data` to the latest response's data. // usage: sendRequest(async () => await yourAPICall(...args)); + // The results from awaiting `fetchFunction`. const [data, setData] = React.useState(null); const latestRequestRef = React.useRef(0); const debounceTimerRef = React.useRef(null); + // Loading while awaiting. const [loading, setLoading] = React.useState(false); const sendRequest = React.useCallback((fetchFunction) => { diff --git a/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot b/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot index da53c8be..42733345 100644 --- a/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot +++ b/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot @@ -47,7 +47,7 @@ sed -i 's/port = 5433/port = 5432/' /etc/postgresql/15/main/postgresql.conf mkdir /media/wrolpi cp /opt/wrolpi/etc/raspberrypios/wrolpi-api.service /etc/systemd/system/ -cp /opt/wrolpi/etc/debian12/wrolpi-app.service /etc/systemd/system/ +cp /opt/wrolpi/etc/raspberrypios/wrolpi-app.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi-kiwix.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi.target /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/renderd.conf /etc/renderd.conf diff --git a/etc/debian12/wrolpi-app.service b/etc/debian12/wrolpi-app.service deleted file mode 100644 index 4f6c5e49..00000000 --- a/etc/debian12/wrolpi-app.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=WROLPi React APP -Wants=wrolpi-api.service -PartOf=wrolpi.target - -[Service] -ExecStart=/usr/local/bin/serve -s build -l 5000 -Group=wrolpi -User=wrolpi -WorkingDirectory=/opt/wrolpi/app/ - -[Install] -WantedBy=default.target diff --git a/etc/raspberrypios/wrolpi-app.service b/etc/raspberrypios/wrolpi-app.service index 11e59b43..4f6c5e49 100644 --- a/etc/raspberrypios/wrolpi-app.service +++ b/etc/raspberrypios/wrolpi-app.service @@ -4,7 +4,7 @@ Wants=wrolpi-api.service PartOf=wrolpi.target [Service] -ExecStart=/usr/bin/serve -s build -l 5000 +ExecStart=/usr/local/bin/serve -s build -l 5000 Group=wrolpi User=wrolpi WorkingDirectory=/opt/wrolpi/app/ diff --git a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh index 71db04c6..9ed87f7d 100755 --- a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh @@ -57,7 +57,7 @@ mkdir /media/wrolpi chown wrolpi:wrolpi /media/wrolpi cp /opt/wrolpi/etc/raspberrypios/wrolpi-api.service /etc/systemd/system/ -cp /opt/wrolpi/etc/debian12/wrolpi-app.service /etc/systemd/system/ +cp /opt/wrolpi/etc/raspberrypios/wrolpi-app.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi-kiwix.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi.target /etc/systemd/system/ diff --git a/repair.sh b/repair.sh index 556696dc..a520bd5a 100755 --- a/repair.sh +++ b/repair.sh @@ -44,11 +44,7 @@ visudo -c -f /etc/sudoers.d/90-wrolpi # Install the systemd services cp /opt/wrolpi/etc/raspberrypios/wrolpi-api.service /etc/systemd/system/ -if [[ ${rpi} == true ]]; then - cp /opt/wrolpi/etc/raspberrypios/wrolpi-app.service /etc/systemd/system/ -else - cp /opt/wrolpi/etc/debian12/wrolpi-app.service /etc/systemd/system/ -fi +cp /opt/wrolpi/etc/raspberrypios/wrolpi-app.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi-kiwix.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi.target /etc/systemd/system/ /usr/bin/systemctl daemon-reload