fix: edit comment not working if used on current folder/breadcrumbs #992
Massimo Melina committed
May 10, 2025 at 21:34 UTC
3c5148b6cebcdc1bfca25b2fc2f5e7ec4317112b
2 files changed
+5
-2
frontend/src/Breadcrumbs.ts
+1
-1
@@ -48,7 +48,7 @@ function Breadcrumb({ path, label, current, ...rest }: { current?: boolean, path
48
onClick(ev) {
49
if (!current) return
50
ev.preventDefault()
51
- void openFileMenu(new DirEntry(decodeURIComponent(path), { p }), ev, [
51
+ void openFileMenu(new DirEntry(decodeURIComponent(path), { p, comment: props?.comment }), ev, [
52
props?.can_upload && {
53
id: 'create-folder',
54
label: t`Create folder`,
frontend/src/fileMenu.ts
+4
-1
@@ -196,7 +196,10 @@ async function editComment(entry: DirEntry) {
196
const res = await inputComment(entry.name, entry.comment)
197
if (res === undefined) return
198
await apiCall('comment', { uri: entry.uri, comment: res }, { modal: working })
199
- updateEntry(entry, e => e.comment = res)
199
+ if (entry.uri === location.pathname) // current folder = breadcrumb
200
+ _.set(state, 'props.comment', res)
201
+ else
202
+ updateEntry(entry, e => e.comment = res)
203
operationSuccessful()
204
}
205