rm recent folders

pull/4837/head
bunsenstraat 8 months ago
parent 672e211067
commit e35bf49893
  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 { 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 ( export default (
commandKeys: Record<string, string>, commandKeys: Record<string, string>,
@ -47,19 +29,6 @@ export default (
execCommand('template:open', focusedWindow); 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', role: 'close',
accelerator: commandKeys['window:close'] accelerator: commandKeys['window:close']

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

Loading…
Cancel
Save