don't show errors deleting a file that was removed in the meantime

Massimo Melina committed Jun 8, 2025 at 19:20 UTC 66eab00c13710b4c0b36eb3db1454ada4390f469
1 file changed +4 -2
frontend/src/menu.ts
+4 -2
@@ -4,7 +4,8 @@ import { state, useSnapState } from './state'
4 import { createElement as h, Fragment, useEffect, useMemo, useState } from 'react'
5 import { alertDialog, confirmDialog, ConfirmOptions, formDialog, toast } from './dialog'
6 import {
7 - err2msg, ErrorMsg, onlyTruthy, prefix, useStateMounted, working, buildUrlQueryString, hIcon, WIKI_URL
7 + err2msg, ErrorMsg, onlyTruthy, prefix, useStateMounted, working, buildUrlQueryString, hIcon,
8 + WIKI_URL, HTTP_NOT_FOUND
9 } from './misc'
10 import { loginDialog } from './login'
11 import { showOptions } from './options'
@@ -193,7 +194,8 @@ export async function deleteFiles(uris: string[]) {
194 return false
195 const stop = working()
196 const errors = onlyTruthy(await Promise.all(uris.map(uri =>
196 - apiCall('delete', {}, { restUri: uri }).then(() => null, err => ({ uri, err }))
197 + apiCall('delete', {}, { restUri: uri })
198 + .then(() => null, err => err?.code !== HTTP_NOT_FOUND && { uri, err })
199 )))
200 stop()
201 reloadList()