diff --git a/package.json b/package.json index a84929bf..f7235737 100644 --- a/package.json +++ b/package.json @@ -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": [ @@ -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", diff --git a/src/i18n.ts b/src/i18n.ts index 9d1b8214..8da8408c 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -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: "Выйти", @@ -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", diff --git a/src/window/dos/dos-runtime.tsx b/src/window/dos/dos-runtime.tsx index 15d04008..03aaf846 100644 --- a/src/window/dos/dos-runtime.tsx +++ b/src/window/dos/dos-runtime.tsx @@ -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]")) { @@ -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, })); } @@ -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"; diff --git a/yarn.lock b/yarn.lock index 4283c67e..13104a59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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== -emulators@8.1.7: - version "8.1.7" - resolved "https://registry.yarnpkg.com/emulators/-/emulators-8.1.7.tgz#01159d7efee15c4d629ae0f0b56f42d5ca91d38f" - integrity sha512-+foHB62mijU8JGE5ggs4+onm1zsWtIz5yqnD7r5jw4L2vM5wukomMsHcSFL67keVnpmvY192ieoUhHxSHNoMEg== +emulators@8.1.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"