feat: enable pinned functionality for minapps and update 'flowith' configuration
This commit is contained in:
parent
b01aca9066
commit
46b314303c
@ -1,6 +1,7 @@
|
||||
/* eslint-disable react/no-unknown-property */
|
||||
import { CloseOutlined, ExportOutlined, PushpinOutlined, ReloadOutlined } from '@ant-design/icons'
|
||||
import { isMac, isWindows } from '@renderer/config/constant'
|
||||
import { DEFAULT_MIN_APPS } from '@renderer/config/minapps'
|
||||
import { useBridge } from '@renderer/hooks/useBridge'
|
||||
import { useMinapps } from '@renderer/hooks/useMinapps'
|
||||
import store from '@renderer/store'
|
||||
@ -31,7 +32,7 @@ const PopupContainer: React.FC<Props> = ({ app, resolve }) => {
|
||||
useBridge()
|
||||
|
||||
const canOpenExternalLink = app.url.startsWith('http://') || app.url.startsWith('https://')
|
||||
const canPinned = !!app.id
|
||||
const canPinned = DEFAULT_MIN_APPS.some((i) => i.id === app?.id)
|
||||
|
||||
const onClose = async (_delay = 0.3) => {
|
||||
setOpen(false)
|
||||
|
||||
@ -266,7 +266,8 @@ export const DEFAULT_MIN_APPS: MinAppType[] = [
|
||||
id: 'flowith',
|
||||
name: 'Flowith',
|
||||
logo: FlowithAppLogo,
|
||||
url: 'https://www.flowith.io/'
|
||||
url: 'https://www.flowith.io/',
|
||||
bodered: true
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ const persistedReducer = persistReducer(
|
||||
{
|
||||
key: 'cherry-studio',
|
||||
storage,
|
||||
version: 58,
|
||||
version: 59,
|
||||
blacklist: ['runtime'],
|
||||
migrate
|
||||
},
|
||||
|
||||
@ -871,6 +871,15 @@ const migrateConfig = {
|
||||
)
|
||||
}
|
||||
return state
|
||||
},
|
||||
'59': (state: RootState) => {
|
||||
if (state.minapps) {
|
||||
const flowith = DEFAULT_MIN_APPS.find((app) => app.id === 'flowith')
|
||||
if (flowith) {
|
||||
state.minapps.enabled.push(flowith)
|
||||
}
|
||||
}
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user