mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
feat: adding console.log
This commit is contained in:
parent
ded56c518d
commit
735b540af4
@ -11,7 +11,6 @@ const getGameBackupPreview = async (
|
||||
) => {
|
||||
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
||||
|
||||
console.log("preview invoked>>");
|
||||
return Ludusavi.getBackupPreview(shop, objectId, backupPath);
|
||||
};
|
||||
|
||||
|
@ -36,11 +36,11 @@ export const watchAchievements = async () => {
|
||||
|
||||
if (!gameAchievementFiles.length) continue;
|
||||
|
||||
// console.log(
|
||||
// "Achievements files to observe for:",
|
||||
// game.title,
|
||||
// gameAchievementFiles
|
||||
// );
|
||||
console.log(
|
||||
"Achievements files to observe for:",
|
||||
game.title,
|
||||
gameAchievementFiles
|
||||
);
|
||||
|
||||
for (const file of gameAchievementFiles) {
|
||||
compareFile(game, file);
|
||||
|
@ -72,7 +72,7 @@ export const updateLocalUnlockedAchivements = async (game: Game) => {
|
||||
|
||||
gameAchievementFiles.push(...achievementFileInsideDirectory);
|
||||
|
||||
// console.log("Achievements files for", game.title, gameAchievementFiles);
|
||||
console.log("Achievements files for", game.title, gameAchievementFiles);
|
||||
|
||||
const unlockedAchievements: UnlockedAchievement[] = [];
|
||||
|
||||
|
@ -12,7 +12,7 @@ import {
|
||||
UserNotLoggedInError,
|
||||
UserWithoutCloudSubscriptionError,
|
||||
} from "@shared";
|
||||
// import { omit } from "lodash-es";
|
||||
import { omit } from "lodash-es";
|
||||
import { appVersion } from "@main/constants";
|
||||
|
||||
interface HydraApiOptions {
|
||||
@ -109,59 +109,59 @@ export class HydraApi {
|
||||
});
|
||||
|
||||
if (this.ADD_LOG_INTERCEPTOR) {
|
||||
// this.instance.interceptors.request.use(
|
||||
// (request) => {
|
||||
// logger.log(" ---- REQUEST -----");
|
||||
// const data = Array.isArray(request.data)
|
||||
// ? request.data
|
||||
// : omit(request.data, ["refreshToken"]);
|
||||
// logger.log(request.method, request.url, request.params, data);
|
||||
// return request;
|
||||
// },
|
||||
// (error) => {
|
||||
// logger.error("request error", error);
|
||||
// return Promise.reject(error);
|
||||
// }
|
||||
// );
|
||||
// this.instance.interceptors.response.use(
|
||||
// (response) => {
|
||||
// logger.log(" ---- RESPONSE -----");
|
||||
// const data = Array.isArray(response.data)
|
||||
// ? response.data
|
||||
// : omit(response.data, ["username", "accessToken", "refreshToken"]);
|
||||
// logger.log(
|
||||
// response.status,
|
||||
// response.config.method,
|
||||
// response.config.url,
|
||||
// data
|
||||
// );
|
||||
// return response;
|
||||
// },
|
||||
// (error) => {
|
||||
// logger.error(" ---- RESPONSE ERROR -----");
|
||||
// const { config } = error;
|
||||
// logger.error(
|
||||
// config.method,
|
||||
// config.baseURL,
|
||||
// config.url,
|
||||
// config.headers,
|
||||
// config.data
|
||||
// );
|
||||
// if (error.response) {
|
||||
// logger.error(
|
||||
// "Response",
|
||||
// error.response.status,
|
||||
// error.response.data
|
||||
// );
|
||||
// } else if (error.request) {
|
||||
// logger.error("Request", error.request);
|
||||
// } else {
|
||||
// logger.error("Error", error.message);
|
||||
// }
|
||||
// logger.error(" ----- END RESPONSE ERROR -------");
|
||||
// return Promise.reject(error);
|
||||
// }
|
||||
// );
|
||||
this.instance.interceptors.request.use(
|
||||
(request) => {
|
||||
logger.log(" ---- REQUEST -----");
|
||||
const data = Array.isArray(request.data)
|
||||
? request.data
|
||||
: omit(request.data, ["refreshToken"]);
|
||||
logger.log(request.method, request.url, request.params, data);
|
||||
return request;
|
||||
},
|
||||
(error) => {
|
||||
logger.error("request error", error);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
this.instance.interceptors.response.use(
|
||||
(response) => {
|
||||
logger.log(" ---- RESPONSE -----");
|
||||
const data = Array.isArray(response.data)
|
||||
? response.data
|
||||
: omit(response.data, ["username", "accessToken", "refreshToken"]);
|
||||
logger.log(
|
||||
response.status,
|
||||
response.config.method,
|
||||
response.config.url,
|
||||
data
|
||||
);
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
logger.error(" ---- RESPONSE ERROR -----");
|
||||
const { config } = error;
|
||||
logger.error(
|
||||
config.method,
|
||||
config.baseURL,
|
||||
config.url,
|
||||
config.headers,
|
||||
config.data
|
||||
);
|
||||
if (error.response) {
|
||||
logger.error(
|
||||
"Response",
|
||||
error.response.status,
|
||||
error.response.data
|
||||
);
|
||||
} else if (error.request) {
|
||||
logger.error("Request", error.request);
|
||||
} else {
|
||||
logger.error("Error", error.message);
|
||||
}
|
||||
logger.error(" ----- END RESPONSE ERROR -------");
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const userAuth = await userAuthRepository.findOne({
|
||||
|
@ -81,10 +81,10 @@ export function BottomPanel() {
|
||||
<small>{status}</small>
|
||||
</button>
|
||||
|
||||
<small>
|
||||
{/* <small>
|
||||
{sessionHash ? `${sessionHash} -` : ""} v{version} "
|
||||
{VERSION_CODENAME}"
|
||||
</small>
|
||||
</small> */}
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ export function UploadBackgroundImageButton() {
|
||||
disabled={isUploadingBackgroundImage}
|
||||
>
|
||||
<UploadIcon />
|
||||
{isUploadingBackgroundImage ? "Uploading..." : "Upload background"}
|
||||
{isUploadingBackgroundImage ? "Uploading..." : "Atualizar banner"}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user