Skip to content

Commit

Permalink
v8.1.17: imrpoved sockdrive reading
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Aug 23, 2024
1 parent 5979c97 commit b6121a5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-dos",
"version": "8.1.16",
"version": "8.1.17",
"description": "Full-featured DOS player with multiple emulator backends",
"type": "module",
"keywords": [
Expand Down Expand Up @@ -37,7 +37,7 @@
"@typescript-eslint/parser": "^6.20.0",
"autoprefixer": "^10.4.17",
"daisyui": "^3.9.3",
"emulators": "8.1.7",
"emulators": "8.1.8",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"postcss": "^8.4.33",
Expand Down
4 changes: 2 additions & 2 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const translations: {[lang: string]: {[key: string]: string} } = {
enter_name_of_drive: "Введите название диска",
ws_outdated: "Необходимо обновить DOS Браузер",
update: "Обновить",
preloading_sockdrive: "Загрузка FAT",
preloading_sockdrive: "Загрузка",
filter: "Фильтр",
add: "Добавить",
logout: "Выйти",
Expand Down Expand Up @@ -87,7 +87,7 @@ const translations: {[lang: string]: {[key: string]: string} } = {
enter_name_of_drive: "Enter name of drive",
ws_outdated: "Must update DOS Browser App",
update: "Update",
preloading_sockdrive: "Preloading FAT",
preloading_sockdrive: "Loading",
filter: "Filter",
add: "Add",
logout: "Logout",
Expand Down
16 changes: 4 additions & 12 deletions src/window/dos/dos-runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function useLog(ci: CommandInterface): void {
const dispatch = useDispatch();
const t = useT();
useEffect(() => {
let totalPreload = 0;
const preloadProgress: { [drive: string]: number } = {};
ci.events().onMessage((msgType, ...args: string[]) => {
if (msgType === "error" && args[0]?.startsWith("[panic]")) {
Expand All @@ -55,20 +54,13 @@ function useLog(ci: CommandInterface): void {
const rest = Number.parseInt(args[0].substring(args[0].indexOf("preload=") + "preload=".length));
if (preloadProgress[drive] === undefined) {
preloadProgress[drive] = rest;
totalPreload += rest;
} else {
preloadProgress[drive] = rest;
}

let downloaded = totalPreload;
for (const rest of Object.values(preloadProgress)) {
downloaded -= rest;
}

dispatch(uiSlice.actions.showToast({
message: t("preloading_sockdrive") + " " +
(Math.round(downloaded / 1024 / 1024 * 100) / 100) + "/" +
(Math.round(totalPreload / 1024 / 1024 * 100) / 100) + "Mb",
drive.substring(drive.indexOf("/") + 1) + " — " +
(Math.round(preloadProgress[drive] - rest) / 1024 / 1024).toFixed(2) + "/" +
(Math.round(preloadProgress[drive] / 1024 / 1024)) + "Mb",
long: true,
}));
}
Expand Down Expand Up @@ -263,7 +255,7 @@ function useLayers(canvas: HTMLCanvasElement, ci: CommandInterface) {
unbindControls();

if (config === null) {
unbindControls = () => {};
unbindControls = () => { };
layers.mouseOverlay.style.display = "none";
} else if (config.version === undefined) {
layers.mouseOverlay.style.display = "block";
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1159,10 +1159,10 @@ electron-to-chromium@^1.4.648:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.653.tgz#832ab25e80ad698ac09c1ca547bd9ee6cce7df10"
integrity sha512-wA2A2LQCqnEwQAvwADQq3KpMpNwgAUBnRmrFgRzHnPhbQUFArTR32Ab46f4p0MovDLcg4uqd4nCsN2hTltslpA==

[email protected].7:
version "8.1.7"
resolved "https://registry.yarnpkg.com/emulators/-/emulators-8.1.7.tgz#01159d7efee15c4d629ae0f0b56f42d5ca91d38f"
integrity sha512-+foHB62mijU8JGE5ggs4+onm1zsWtIz5yqnD7r5jw4L2vM5wukomMsHcSFL67keVnpmvY192ieoUhHxSHNoMEg==
[email protected].8:
version "8.1.8"
resolved "https://registry.yarnpkg.com/emulators/-/emulators-8.1.8.tgz#7046833aed33d8cb6d4ceb24c2a754e5c421b8b3"
integrity sha512-RtvCrFu+LyW2NHoOzDzMeJ5g50Hf10GQuBvC6OP4ZW7IKj+5k1CATpebjklMgZzKB2G7qGLc/mGOUfi8zglNmQ==

entities@^4.2.0:
version "4.5.0"
Expand Down

0 comments on commit b6121a5

Please sign in to comment.