mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
🐛 Fix(custom): fix the issue of webcontents
This commit is contained in:
@@ -74,7 +74,7 @@ class GuiApi implements IGuiApi {
|
||||
this.windowId = await getWindowId()
|
||||
const webContents = this.getWebcontentsByWindowId(this.windowId)
|
||||
const rawInput = cloneDeep(input)
|
||||
const res = await uploader.setWebContents(webContents!).uploadReturnCtx(input)
|
||||
const res = await uploader.setWebContents(webContents).uploadReturnCtx(input)
|
||||
const imgs = res.ctx?.output ? res.ctx.output : false
|
||||
const backImgs = res.backupCtx?.output ? res.backupCtx.output : false
|
||||
let result: ImgInfo[] = []
|
||||
|
||||
@@ -56,13 +56,13 @@ const trayRoutes = [
|
||||
await GalleryDB.getInstance().insert(img[0])
|
||||
trayWindow?.webContents.send('clipboardFiles', [])
|
||||
if (windowManager.has(IWindowList.SETTING_WINDOW)) {
|
||||
windowManager.get(IWindowList.SETTING_WINDOW)!.webContents.send('updateGallery')
|
||||
windowManager.get(IWindowList.SETTING_WINDOW)?.webContents.send('updateGallery')
|
||||
}
|
||||
if (backupImgs && backupImgs.length > 0) {
|
||||
await GalleryDB.getInstance().insert(backupImgs[0])
|
||||
trayWindow?.webContents.send('uploadFiles')
|
||||
if (windowManager.has(IWindowList.SETTING_WINDOW)) {
|
||||
windowManager.get(IWindowList.SETTING_WINDOW)!.webContents?.send('updateGallery')
|
||||
windowManager.get(IWindowList.SETTING_WINDOW)?.webContents?.send('updateGallery')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class UploadTaskQueueManager {
|
||||
maxRetryCount: 3,
|
||||
}
|
||||
|
||||
private webContents: WebContents | null = null
|
||||
private webContents: WebContents | undefined = undefined
|
||||
private persistPath = path.join(dataDir(), 'taskQueue.json')
|
||||
private taskTimer: NodeJS.Timeout | null = null
|
||||
|
||||
@@ -230,10 +230,6 @@ class UploadTaskQueueManager {
|
||||
const win = windowManager.getAvailableWindow()
|
||||
const webContents = this.webContents || win?.webContents
|
||||
|
||||
if (!webContents) {
|
||||
throw new Error('No webContents available for upload')
|
||||
}
|
||||
|
||||
const input = [task.filePath]
|
||||
const rawInput = cloneDeep(input)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<!-- System Settings Tab -->
|
||||
<div
|
||||
v-if="currentTab === 'system'"
|
||||
class="border4 no-scrollbar flex h-full w-full flex-1 flex-col gap-6 overflow-auto p-4"
|
||||
class="no-scrollbar flex h-full w-full flex-1 flex-col gap-6 overflow-auto p-4"
|
||||
>
|
||||
<SettingSection :title="t('pages.settings.system.languageAndAppearance')" :icon="Globe">
|
||||
<SettingCard>
|
||||
|
||||
Reference in New Issue
Block a user