(res)
| 60 | Helpers: safe JSON + state |
| 61 | ----------------------*/ |
| 62 | async function safeJson(res) { |
| 63 | const text = await res.text(); |
| 64 | let body = null; |
| 65 | try { body = text ? JSON.parse(text) : null; } catch (e) { /* ignore */ } |
| 66 | if (!res.ok) { |
| 67 | const msg = (body && (body.error || body.message)) || (text && text.trim()) || `HTTP ${res.status}`; |
| 68 | const err = new Error(msg); |
| 69 | err.status = res.status; |
| 70 | throw err; |
| 71 | } |
| 72 | return body ?? {}; |
| 73 | } |
| 74 | |
| 75 | function disableAllFolderControls() { |
| 76 | ['createFolderBtn','moveFolderBtn','renameFolderBtn','colorFolderBtn','deleteFolderBtn','shareFolderBtn'] |
no outgoing calls
no test coverage detected