From f8184e57dc439a32e705058eaa273e3787616ae2 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 19 Mar 2024 18:48:10 +0100 Subject: [PATCH] rm recent folders --- apps/remixdesktop/src/menus/file.ts | 31 --------------------------- apps/remixdesktop/src/utils/config.ts | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/apps/remixdesktop/src/menus/file.ts b/apps/remixdesktop/src/menus/file.ts index 3693da348f..7b48bd94f6 100644 --- a/apps/remixdesktop/src/menus/file.ts +++ b/apps/remixdesktop/src/menus/file.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, @@ -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'] diff --git a/apps/remixdesktop/src/utils/config.ts b/apps/remixdesktop/src/utils/config.ts index 4cbb17a3e0..df7b8c8d15 100644 --- a/apps/remixdesktop/src/utils/config.ts +++ b/apps/remixdesktop/src/utils/config.ts @@ -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 {