Skip to content

Commit

Permalink
Merge pull request #62 from ArcticLampyrid/main
Browse files Browse the repository at this point in the history
fix: no error message for empty quota info
  • Loading branch information
n-peugnet committed Jan 10, 2024
2 parents 7c7acee + 6130800 commit d080788
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
$: isSmallScreen.set(width <= 610);
$: locale.set(lang);
$: localStorage.setItem("lang", lang);
$: fs?.getQuota().then((a) => (quota = a)) ?? (quota = null);
$: fs?.getQuota()
.then((a) => (quota = a))
.catch(() => (quota = null)) ?? (quota = null);
let username = localStorage.getItem("username");
let password = localStorage.getItem("password");
Expand Down
3 changes: 3 additions & 0 deletions src/model/webdav/WebdavFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ export class WebdavFileSystem extends FileSystemBase implements FileSystem {
* @returns the data.
*/
function extractData<T>(res: T | ResponseDataDetailed<T>): T {
if (res === null || res === undefined) {
throw new Error("No data.");
}
if (isDetailedData(res)) {
return res.data;
} else {
Expand Down

0 comments on commit d080788

Please sign in to comment.