Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
alejooroncoy committed Jul 26, 2023
2 parents d612297 + bcd3eac commit ce1583e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog 📃

## 0.0.5

<h4>Bugs 🐞</h4>

* Update error in refresh host 📃🌟

## 0.0.4

<h4>Features ✨</h4>
Expand Down
2 changes: 1 addition & 1 deletion contexts/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contexts/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "psm",
"description": "Pes6 server manager helps its users to be able to have control of the servers where they play. In this way, with a few simple clicks, play PES 6 on the server of your choice. 💻⚽",
"private": true,
"version": "0.0.4",
"version": "0.0.5",
"license": "GNU AGPLv3",
"scripts": {
"dev": "next dev -p 1420",
Expand Down
2 changes: 1 addition & 1 deletion contexts/app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "PSM",
"version": "0.0.4"
"version": "0.0.5"
},
"tauri": {
"allowlist": {
Expand Down
6 changes: 3 additions & 3 deletions contexts/app/src/utils/getHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import logger from "../libs/logger.js";

export const getHostFromUrl = (
host,
{ refetching = false, config: configCache } = {}
{ refetching = false, config: configCache, forceUpdate } = {}
) => {
const cb = async (res, rej) => {
try {
Expand Down Expand Up @@ -38,13 +38,13 @@ export const getHostFromUrl = (
await saveCacheHost(host, data);
logger.log(`Loaded hosts ✨📋`);
logger.log(`Saved host in cache ✨📁`);
if (refetching) {
if (refetching && !forceUpdate) {
configCache.hostTimeExpire = new Date(
new Date().getTime() + TIME_EXPIRED
);
return res();
}
await setConfigHost(host);
await setConfigHost(host, forceUpdate);
res();
} catch (err) {
rej(err);
Expand Down
7 changes: 5 additions & 2 deletions contexts/app/src/utils/refreshHost.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { setConfigHost } from "../config/cache";
import { getHostFromUrl } from "./getHost";

export default async function refreshHost(hostname) {
await setConfigHost(hostname, true);
await getHostFromUrl(hostname, {
refetching: true,
forceUpdate: true,
});
}

1 comment on commit ce1583e

@vercel
Copy link

@vercel vercel bot commented on ce1583e Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.