better reverse proxy detection (#101)

This commit is contained in:
Michael M. Chang
2023-11-04 10:00:28 -04:00
committed by GitHub
parent a52225323c
commit 710a8537e0
5 changed files with 3252 additions and 3 deletions

3249
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,7 @@
},
"author": "marcopeocchi",
"license": "MPL-2.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",

View File

@@ -127,7 +127,7 @@ export const listViewState = atom({
export const servedFromReverseProxyState = atom({
key: 'servedFromReverseProxyState',
default: localStorage.getItem('reverseProxy') === "true",
default: localStorage.getItem('reverseProxy') === "true" || window.location.port == "",
effects: [
({ onSet }) =>
onSet(a => localStorage.setItem('reverseProxy', a.toString()))

View File

@@ -27,6 +27,7 @@ export const freeSpaceBytesState = selector({
key: 'freeSpaceBytesState',
get: async ({ get }) => {
const res = await get(rpcClientState).freeSpace()
.catch(() => ({ result: 0 }))
return res.result
}
})