Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions packages/shared/IpcChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export enum IpcChannel {
App_SetFullScreen = 'app:set-full-screen',
App_IsFullScreen = 'app:is-full-screen',
App_GetSystemFonts = 'app:get-system-fonts',
App_GetIpCountry = 'app:get-ip-country',
APP_CrashRenderProcess = 'app:crash-render-process',

App_MacIsProcessTrusted = 'app:mac-is-process-trusted',
Expand Down
6 changes: 6 additions & 0 deletions src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { loggerService } from '@logger'
import { isLinux, isMac, isPortable, isWin } from '@main/constant'
import { generateSignature } from '@main/integration/cherryai'
import anthropicService from '@main/services/AnthropicService'
import { getIpCountry } from '@main/utils/ipService'
import {
autoDiscoverGitBash,
getBinaryPath,
Expand Down Expand Up @@ -303,6 +304,11 @@ export async function registerIpc(mainWindow: BrowserWindow, app: Electron.App)
}
})

// Get IP Country
ipcMain.handle(IpcChannel.App_GetIpCountry, async () => {
return getIpCountry()
})

ipcMain.handle(IpcChannel.Config_Set, (_, key: string, value: any, isNotify: boolean = false) => {
configManager.set(key, value, isNotify)
})
Expand Down
1 change: 1 addition & 0 deletions src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const api = {
setFullScreen: (value: boolean): Promise<void> => ipcRenderer.invoke(IpcChannel.App_SetFullScreen, value),
isFullScreen: (): Promise<boolean> => ipcRenderer.invoke(IpcChannel.App_IsFullScreen),
getSystemFonts: (): Promise<string[]> => ipcRenderer.invoke(IpcChannel.App_GetSystemFonts),
getIpCountry: (): Promise<string> => ipcRenderer.invoke(IpcChannel.App_GetIpCountry),
mockCrashRenderProcess: () => ipcRenderer.invoke(IpcChannel.APP_CrashRenderProcess),
mac: {
isProcessTrusted: (): Promise<boolean> => ipcRenderer.invoke(IpcChannel.App_MacIsProcessTrusted),
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/src/components/MinApp/MinApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const MinApp: FC<Props> = ({ app, onClick, size = 60, isLast }) => {
const navigate = useNavigate()
const isPinned = pinned.some((p) => p.id === app.id)
const isVisible = minapps.some((m) => m.id === app.id)
// Pinned apps should always be visible regardless of region/locale filtering
const shouldShow = isVisible || isPinned
const isActive = minappShow && currentMinappId === app.id
const isOpened = openedKeepAliveMinapps.some((item) => item.id === app.id)
const { isTopNavbar } = useNavbarPosition()
Expand Down Expand Up @@ -107,7 +109,7 @@ const MinApp: FC<Props> = ({ app, onClick, size = 60, isLast }) => {
: [])
]

if (!isVisible) {
if (!shouldShow) {
return null
}

Expand Down
Loading