mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
allquestions dbs cache fix, minor style changes
This commit is contained in:
parent
14d8e43083
commit
1337bcdd1a
5 changed files with 15 additions and 10 deletions
|
@ -52,7 +52,7 @@ export default function QuestionSearchResult({ data, searchTerm }) {
|
||||||
próbáld bővíteni a keresési feltételt!`}
|
próbáld bővíteni a keresési feltételt!`}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{results > 0 && <div>{`${results} találat.`}</div>}
|
{results > 0 && searchTerm ? <div>{`${results} találat.`}</div> : null}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ export default function DbSelector({ onDbSelect, closeClick, text, showAll }) {
|
||||||
const [qdbs, setQdbs] = useState(null)
|
const [qdbs, setQdbs] = useState(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.info('Fetching dbs')
|
|
||||||
fetch(`${constants.apiUrl}getDbs`, {
|
fetch(`${constants.apiUrl}getDbs`, {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
})
|
})
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
padding: 0px 8px;
|
padding: 0px 8px;
|
||||||
margin: 0px 2px;
|
margin: 0px 2px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
transition: width 0.5s, height 0.5s, ease-in 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topBarLinks > *:hover {
|
.topBarLinks > *:hover {
|
||||||
|
@ -56,7 +57,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.topBarLinks a.active {
|
.topBarLinks a.active {
|
||||||
border: 0.5px solid var(--text-color);
|
background-color: var(--hoover-color);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@
|
||||||
margin: 5px 2px;
|
margin: 5px 2px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: var(--bright-color);
|
color: var(--bright-color);
|
||||||
transition: width 0.5s, height 0.5s, ease-in 0.5s;
|
transition: width 0.5s, height 0.5s, ease-in 0.2s;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +128,7 @@
|
||||||
color: black;
|
color: black;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-shadow: 2px 2px 8px black;
|
text-shadow: 2px 2px 8px black;
|
||||||
transition: width 0.5s, height 0.5s, ease-out 0.5s;
|
transition: width 0.5s, height 0.5s, ease-out 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.userStatus {
|
.userStatus {
|
||||||
|
|
|
@ -57,7 +57,6 @@ function fetchAllData(dbs) {
|
||||||
|
|
||||||
function fetchDbs() {
|
function fetchDbs() {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
console.info('Fetching data')
|
|
||||||
fetch(`${constants.apiUrl}getDbs`, {
|
fetch(`${constants.apiUrl}getDbs`, {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
})
|
})
|
||||||
|
@ -86,9 +85,16 @@ export default function AllQuestions({ router, globalState, setGlobalState }) {
|
||||||
router.replace(`${router.asPath.replace('.html', '')}`, undefined, {
|
router.replace(`${router.asPath.replace('.html', '')}`, undefined, {
|
||||||
shallow: true,
|
shallow: true,
|
||||||
})
|
})
|
||||||
|
if (globalState.qdbs) {
|
||||||
|
setDbs(globalState.qdbs)
|
||||||
|
} else {
|
||||||
fetchDbs().then((res) => {
|
fetchDbs().then((res) => {
|
||||||
setDbs(res)
|
setDbs(res)
|
||||||
|
setGlobalState({
|
||||||
|
qdbs: res,
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -50,7 +50,6 @@ function getSinceDate(keyword) {
|
||||||
|
|
||||||
async function getListFromServer(since) {
|
async function getListFromServer(since) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
console.info('Fetching data')
|
|
||||||
let query = ''
|
let query = ''
|
||||||
if (since && since !== 'all') {
|
if (since && since !== 'all') {
|
||||||
query = `?since=${getTimeString(getSinceDate(since))}`
|
query = `?since=${getTimeString(getSinceDate(since))}`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue