(children, props)
| 235 | const ProgressBar = ErrorBoundary.wrap(ProgressBarInner, { noop: true }); |
| 236 | |
| 237 | const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => { |
| 238 | if (!props) return; |
| 239 | |
| 240 | const { itemSrc, itemHref, target } = props; |
| 241 | const url = getMediaUrl({ src: itemSrc, href: itemHref, target }); |
| 242 | |
| 243 | if (!url) return; |
| 244 | |
| 245 | const group = findGroupChildrenByChildId("open-native-link", children) |
| 246 | ?? findGroupChildrenByChildId("copy-link", children); |
| 247 | |
| 248 | if (group && !group.some(child => child?.props?.id === "file-upload")) { |
| 249 | const serviceType = settings.store.serviceType as ServiceType; |
| 250 | const serviceName = serviceLabels[serviceType]; |
| 251 | |
| 252 | group.push( |
| 253 | <Menu.MenuItem |
| 254 | label={`Upload to ${serviceName}`} |
| 255 | key="file-upload" |
| 256 | id="file-upload" |
| 257 | action={() => uploadFile(url)} |
| 258 | /> |
| 259 | ); |
| 260 | } |
| 261 | }; |
| 262 | |
| 263 | const imageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => { |
| 264 | if (!props) return; |
nothing calls this directly
no test coverage detected