Skip to content

Commit f860b08

Browse files
Dan PastusekDan Pastusek
authored andcommitted
fix lint errors
1 parent 0f9b316 commit f860b08

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

bin/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e # bail on error
33

4-
4+
yarn lint
55

66
# Build and package
77
PIBOX_HOST_VERSION=v$(cat package.json | jq -r .version)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pibox-host",
3-
"version": "1.45.0",
3+
"version": "1.44.0",
44
"private": true,
55
"bin": "server.js",
66
"scripts": {

src/pages/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export default function Home() {
6060
<ol className="list-decimal list-inside pl-4 mt-4">
6161
<li>Open Finder → Locations → Network</li>
6262
<li>Open PIBOX</li>
63-
<li>Click the "Connect As..." button</li>
63+
<li>Click the &quot;Connect As...&quot; button</li>
6464
<ol className="list-disc list-inside ml-6">
65-
<li>Select "Registered User"</li>
65+
<li>Select &quot;Registered User&quot;</li>
6666
<li>
6767
Name: <span className="text-slate-600 bg-slate-200 border rounded border-slate-400 px-1 py-0.5 text-sm">{whoami.linuxUser}</span>
6868
</li>
@@ -82,10 +82,10 @@ export default function Home() {
8282
Enter <b className="font-semibold">\\pibox.local</b>
8383
and click <b className="font-semibold">Browse</b>
8484
</li>
85-
<li>Expand "pibox.local"</li>
86-
<li>A dialog titled "Enter network credentials" appears</li>
85+
<li>Expand &quot;pibox.local&quot;</li>
86+
<li>A dialog titled &quot;Enter network credentials&quot; appears</li>
8787
<ol className="list-disc list-inside ml-6">
88-
<li>Select "Registered User"</li>
88+
<li>Select &quot;Registered User&quot;</li>
8989
<li>
9090
User name: <span className="text-slate-600 bg-slate-200 border rounded border-slate-400 px-1 py-0.5 text-sm">{whoami.linuxUser}</span>
9191
</li>

src/pages/settings.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,6 @@ export default function Home() {
77
const [enabled, setEnabled] = useState([])
88
const [passwordLogin, setPasswordLogin] = useState([])
99

10-
async function whoami() {
11-
if (typeof window === 'undefined') return
12-
const { body } = await fetchApi('/api/whoami')
13-
if (body.piboxConfigUser) {
14-
getSshSettings()
15-
} else {
16-
window.location.href = '/login'
17-
}
18-
}
19-
20-
async function getSshSettings() {
21-
if (typeof window === 'undefined') return
22-
const { body } = await fetchApi('/api/ssh')
23-
setLoading(false)
24-
setEnabled(body.enabled)
25-
setPasswordLogin(body.passwordLogin)
26-
}
27-
2810
async function updateSshSettings({ enabled, passwordLogin }) {
2911
setLoading(true)
3012
setEnabled(enabled)
@@ -37,7 +19,26 @@ export default function Home() {
3719
setLoading(false)
3820
}
3921

40-
useEffect(() => whoami(), [])
22+
useEffect(() => {
23+
async function whoami() {
24+
if (typeof window === 'undefined') return
25+
const { body } = await fetchApi('/api/whoami')
26+
if (body.piboxConfigUser) {
27+
getSshSettings()
28+
} else {
29+
window.location.href = '/login'
30+
}
31+
}
32+
33+
async function getSshSettings() {
34+
if (typeof window === 'undefined') return
35+
const { body } = await fetchApi('/api/ssh')
36+
setLoading(false)
37+
setEnabled(body.enabled)
38+
setPasswordLogin(body.passwordLogin)
39+
}
40+
whoami()
41+
}, [])
4142

4243
return (
4344
<>

0 commit comments

Comments
 (0)