* * @param {Storage} storage * @param {Boolean} doesReload
(storage, doesReload = true)
| 1584 | * @param {Boolean} doesReload |
| 1585 | */ |
| 1586 | function updateStorage(storage, doesReload = true) { |
| 1587 | if (storage.uuid) { |
| 1588 | storageList = storageList.filter((s) => s.uuid !== storage.uuid); |
| 1589 | } else { |
| 1590 | storage.uuid = helpers.uuid(); |
| 1591 | } |
| 1592 | |
| 1593 | if (!storage.type) { |
| 1594 | storage.type = "dir"; |
| 1595 | } |
| 1596 | |
| 1597 | if (!storage.storageType) { |
| 1598 | storage.storageType = storage.type; |
| 1599 | } |
| 1600 | |
| 1601 | storageList.push(storage); |
| 1602 | localStorage.storageList = JSON.stringify(storageList); |
| 1603 | if (doesReload) reload(); |
| 1604 | } |
| 1605 | |
| 1606 | function render(dir) { |
| 1607 | const { list, scroll } = dir; |
no test coverage detected