mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-03 14:50:57 +08:00
🔨 Refactor(custom): refactored manage page ipc
This commit is contained in:
@@ -31,7 +31,7 @@ import { IConfig } from 'piclist'
|
||||
import { onBeforeUnmount, onBeforeMount, ref, watch } from 'vue'
|
||||
|
||||
import { T as $T } from '@/i18n/index'
|
||||
import { invokeToMain, sendRPC } from '@/utils/common'
|
||||
import { sendRPC, triggerRPC } from '@/utils/common'
|
||||
import { getConfig } from '@/utils/dataSender'
|
||||
import { osGlobal } from '@/utils/global'
|
||||
|
||||
@@ -53,7 +53,8 @@ async function initLogoPath() {
|
||||
if (config) {
|
||||
if (config.settings?.isCustomMiniIcon && config.settings?.customMiniIcon) {
|
||||
logoPath.value =
|
||||
'data:image/jpg;base64,' + (await invokeToMain('convertPathToBase64', config.settings.customMiniIcon))
|
||||
'data:image/jpg;base64,' +
|
||||
(await triggerRPC(IRPCActionType.MANAGE_CONVERT_PATH_TO_BASE64, config.settings.customMiniIcon))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ import { configPaths, ISartModeValues } from '#/utils/configPaths'
|
||||
import { getLatestVersion } from '#/utils/getLatestVersion'
|
||||
|
||||
import pkg from 'root/package.json'
|
||||
import { invokeToMain, sendRPC, triggerRPC } from '@/utils/common'
|
||||
import { sendRPC, triggerRPC } from '@/utils/common'
|
||||
|
||||
const $router = useRouter()
|
||||
const activeName = ref<'system' | 'syncAndConfigure' | 'upload' | 'advanced' | 'upadte'>('system')
|
||||
@@ -1420,7 +1420,7 @@ function handleMiniWindowOntop(val: ICheckBoxValueType) {
|
||||
}
|
||||
|
||||
async function handleMiniIconPath(_: Event) {
|
||||
const result = await invokeToMain('openFileSelectDialog')
|
||||
const result = await triggerRPC<string[]>(IRPCActionType.MANAGE_OPEN_FILE_SELECT_DIALOG)
|
||||
if (result && result[0]) {
|
||||
formOfSetting.value.customMiniIcon = result[0]
|
||||
saveConfig(configPaths.settings.customMiniIcon, formOfSetting.value.customMiniIcon)
|
||||
|
||||
Reference in New Issue
Block a user