@samitouri / QOSami-HFS / commits / 9c72677e

show just a notification if pasting files went well #875

Massimo Melina committed Jan 19, 2025 at 18:17 UTC 9c72677e85f951dc99710f8ca9cde7470bd2906e
1 file changed +11 -7
frontend/src/clip.ts
+11 -7
@@ -51,13 +51,17 @@ export function ClipBar() {
51 uri_to: here,
52 }).then(res => {
53 const bad = _.sumBy(res.errors, x => x ? 1 : 0)
54 - alertDialog(h(Fragment, {},
55 - t('good_bad', { bad, good: clip.length - bad }, "{good} moved, {bad} failed"),
56 - h('ul', {}, res.errors.map(((e: any, i: number) => {
57 - e = xlate(e, HTTP_MESSAGES)
58 - return e && h('li', {}, clip[i].name + ': ' + e)
59 - }))),
60 - ), bad ? 'warning' : 'info')
54 + const msg = t('good_bad', { bad, good: clip.length - bad }, "{good} moved, {bad} failed")
55 + if (!bad)
56 + toast(msg, 'success')
57 + else
58 + alertDialog(h(Fragment, {},
59 + msg,
60 + h('ul', {}, res.errors.map(((e: any, i: number) => {
61 + e = xlate(e, HTTP_MESSAGES)
62 + return e && h('li', {}, clip[i].name + ': ' + e)
63 + }))),
64 + ), 'warning')
65 cancel()
66 reloadList()
67 }, alertDialog)