Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 0 additions & 162 deletions apps/shell/src/main/cloud-projects.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/shell/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ import {
windowMenuTemplate,
} from '@hermesoffice/electron-utils'
import { readAppSettings, writeAppSetting } from './app-settings'
import {
clearCloudProjectsStore,
cloudProjectExternalUrl,
readCloudProjectsStore,
syncCloudProjects,
} from './cloud-projects'
import { ProjectStore } from '@hermesoffice/project-store'
import {
buildTarget,
Expand Down Expand Up @@ -2117,7 +2111,6 @@ function registerHomeIpc(): void {

ipcMain.handle(HOME_CHANNELS.accountLogout, async () => {
// Fork: não há conta remota para encerrar sessão; só limpa o cache local
clearCloudProjectsStore(cloudProjectsStorePath())
})
Comment on lines 2112 to 2114

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep clearing the legacy cloud-project cache

For users upgrading from a version that populated userData/cloud-projects.json, logout now leaves that file behind because this call was its only unconditional cleanup path and the module that could otherwise reject/delete it has also been removed. The cache contains project titles and URLs, so account metadata can remain on disk indefinitely after logout or feature removal; retain a small legacy-file cleanup here or perform it during startup migration.

Useful? React with 👍 / 👎.

ipcMain.handle(HOME_CHANNELS.getAppVersion, (): string => app.getVersion())

Expand Down Expand Up @@ -2385,19 +2378,6 @@ function registerHomeIpc(): void {
// no browser handler available; nothing actionable for the user here
})
})

const cloudProjectsStorePath = () => join(app.getPath('userData'), 'cloud-projects.json')

ipcMain.handle(HOME_CHANNELS.cloudProjectsCached, () =>
readCloudProjectsStore(cloudProjectsStorePath()),
)

ipcMain.handle(HOME_CHANNELS.cloudProjects, () => syncCloudProjects(cloudProjectsStorePath()))

ipcMain.handle(HOME_CHANNELS.openCloudProject, (_event, projectUrl: unknown) => {
const url = cloudProjectExternalUrl(projectUrl)
if (url) void shell.openExternal(url)
})
}

function stringPaths(value: unknown): string[] {
Expand Down
29 changes: 0 additions & 29 deletions apps/shell/src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { IpcRendererEvent } from 'electron'
import type {
AccountLoginEvent,
AccountStatus,
CloudProjectsSnapshot,
HomeApi,
RecentEntry,
RecentPage,
Expand Down Expand Up @@ -196,37 +195,9 @@ const homeApi: HomeApi = {
async openCreditUsage() {
await ipcRenderer.invoke(HOME_CHANNELS.openCreditUsage)
},
async cloudProjectsCached() {
const result: unknown = await ipcRenderer.invoke(HOME_CHANNELS.cloudProjectsCached)
return asCloudProjectsSnapshot(result)
},
async cloudProjectsSync() {
// failures (network / CLI) resolve to null so the renderer keeps whatever it has
try {
const result: unknown = await ipcRenderer.invoke(HOME_CHANNELS.cloudProjects)
return asCloudProjectsSnapshot(result)
} catch {
return null
}
},
async openCloudProject(projectUrl) {
if (typeof projectUrl !== 'string' || !projectUrl) throw new Error('Invalid project URL.')
await ipcRenderer.invoke(HOME_CHANNELS.openCloudProject, projectUrl)
},
hermesStatus: () => ipcRenderer.invoke(HOME_CHANNELS.hermesStatus),
}

function asCloudProjectsSnapshot(result: unknown): CloudProjectsSnapshot | null {
if (
result &&
typeof result === 'object' &&
Array.isArray((result as CloudProjectsSnapshot).projects)
) {
return result as CloudProjectsSnapshot
}
return null
}

contextBridge.exposeInMainWorld('aiOffice', homeApi)

const projectApi: ProjectHomeApi = {
Expand Down
Loading
Loading