{"record":{"id":"a87874e8613e70b6","repo":"libnyanpasu/clash-nyanpasu","slug":"not-support","errorCode":null,"errorMessage":"Not Support","messagePattern":"Not Support","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/nyanpasu/src/pages/(main)/main/settings/nyanpasu/_modules/tray-icon-config.tsx","lineNumber":58,"sourceCode":"  })\n\n  const [isLoading, setIsLoading] = useState(false)\n\n  const handleChangeIcon = useLockFn(async () => {\n    try {\n      const selected = await open({\n        directory: false,\n        multiple: false,\n        filters: [\n          {\n            name: 'Images',\n            extensions: ['png', 'jpg', 'jpeg', 'bmp', 'ico'],\n          },\n        ],\n      })\n\n      if (Array.isArray(selected)) {\n        throw new Error('Not Support')\n      } else if (selected === null) {\n        return null\n      }\n\n      setIsLoading(true)\n\n      await commands.setTrayIcon(mode, selected)\n      await isIconSet.refetch()\n      setIconVersion((prev) => prev + 1)\n\n      message(m.settings_nyanpasu_tray_icon_set_success(), {\n        kind: 'info',\n      })\n    } catch (e) {\n      console.error(e)\n      message(m.settings_nyanpasu_tray_icon_set_failed(), {\n        kind: 'error',\n      })","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/frontend/nyanpasu/src/pages/(main)/main/settings/nyanpasu/_modules/tray-icon-config.tsx#L40-L76","documentation":"TrayIconItem's file dialog is configured for single selection; if the dialog somehow returns an array (multiple selections), the code throws 'Not Support' because multi-select tray icons are not implemented.","triggerScenarios":"Selecting a tray icon file when the dialog result is an array — occurs when the picker is invoked in a way that permits multiple selection or a platform quirk returns a list.","commonSituations":"Users on platforms/dialog implementations that return arrays from the open dialog trying to set a custom tray icon.","solutions":["Select exactly one file in the dialog","Pick a single png/jpg/jpeg/bmp/ico file when choosing a custom tray icon","If it persists, reset the tray icon setting to default"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (Array.isArray(selected)) {\n  showToast('Please select a single icon file')\n  return\n}","typeGuard":"const isSingleFile = (v: unknown): v is string => typeof v === 'string'","tryCatchPattern":"try {\n  await pickTrayIcon()\n} catch (e) {\n  if (e instanceof Error && e.message === 'Not Support') {\n    showToast('Multi-select is not supported for tray icons')\n  }\n}","preventionTips":["Configure the dialog with multiple: false and enforce it","Validate the dialog result type before use","Document single-file selection in the picker UI"],"tags":["file-dialog","tray-icon","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}