rm recent folders

pull/5370/head
bunsenstraat 8 months ago
parent d7c67231fc
commit f8184e57dc
  1. 31
      apps/remixdesktop/src/menus/file.ts
  2. 2
      apps/remixdesktop/src/utils/config.ts

@ -1,22 +1,4 @@
import { BrowserWindow, MenuItemConstructorOptions, app, ipcMain } from 'electron';
import fs from 'fs'
import os from 'os'
import path from 'path'
import { cacheDir } from '../utils/config';
let recentFolders: string[] = []
if (fs.existsSync(cacheDir + '/remixdesktop.json')) {
try {
// read the cache file
const cache = fs.readFileSync(cacheDir + '/remixdesktop.json')
const data = JSON.parse(cache.toString())
recentFolders = data && data.recentFolders || []
console.log('recentFolders', recentFolders)
} catch (e) {
}
}
export default (
commandKeys: Record<string, string>,
@ -47,19 +29,6 @@ export default (
execCommand('template:open', focusedWindow);
}
},
{
role: 'recentDocuments',
submenu: recentFolders.map((folder) => {
return {
label: folder,
click(item, focusedWindow) {
if(focusedWindow) {
ipcMain.emit('fs:openFolder', focusedWindow.webContents.id, folder);
}
}
}
})
},
{
role: 'close',
accelerator: commandKeys['window:close']

@ -4,7 +4,7 @@ import path from 'path'
export const cacheDir = path.join(os.homedir(), '.cache_remix_ide')
console.log('cacheDir', cacheDir)
console.log('cache dir is:', cacheDir)
export const createDefaultConfigLocations = async() => {
try {

Loading…
Cancel
Save