Skip to content

Commit

Permalink
Fix for #10
Browse files Browse the repository at this point in the history
Will be in v1.1.0
  • Loading branch information
jtsage committed Nov 6, 2022
1 parent 1488133 commit 1fb4fa5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modAssist_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,13 @@ ipcMain.on('toMain_getText_send', (event, l10nSet) => {
event.sender.send('fromMain_getText_return', [l10nEntry, mcDetail.version])
} else if ( l10nEntry === 'clean_cache_size' ) {
const cleanString = myTranslator.syncStringLookup(l10nEntry)
const cacheStats = fs.statSync(path.join(app.getPath('userData'), 'mod_cache.json'))
let cacheSize = 0
try {
const cacheStats = fs.statSync(path.join(app.getPath('userData'), 'mod_cache.json'))
cacheSize = cacheStats.size/(1024*1024)
} catch { /* ignore */ }

event.sender.send('fromMain_getText_return', [l10nEntry, `${cleanString} ${(cacheStats.size/(1024*1024)).toFixed(2)}MB`])
event.sender.send('fromMain_getText_return', [l10nEntry, `${cleanString} ${cacheSize.toFixed(2)}MB`])
} else {
myTranslator.stringLookup(l10nEntry).then((text) => {
event.sender.send('fromMain_getText_return', [l10nEntry, text])
Expand Down

0 comments on commit 1fb4fa5

Please sign in to comment.