Polish: suppress error banner for transient sync failures and sort remote folders
Only show the error banner for non-transient sync failures; connectivity issues (timeout, refused, unreachable) just update the status dot. Sort workspace entries above regular folders in the remote folder browser.
This commit is contained in:
parent
fbf1ba69ef
commit
7cc899470f
|
|
@ -106,12 +106,14 @@
|
||||||
browseLoading = true;
|
browseLoading = true;
|
||||||
browseError = null;
|
browseError = null;
|
||||||
try {
|
try {
|
||||||
browseEntries = await invoke("list_remote_folder", {
|
const entries: typeof browseEntries = await invoke("list_remote_folder", {
|
||||||
url: webdavUrl,
|
url: webdavUrl,
|
||||||
username: webdavUser,
|
username: webdavUser,
|
||||||
password: webdavPass,
|
password: webdavPass,
|
||||||
path: currentBrowsePath,
|
path: currentBrowsePath,
|
||||||
});
|
});
|
||||||
|
entries.sort((a, b) => (a.is_workspace === b.is_workspace ? 0 : a.is_workspace ? -1 : 1));
|
||||||
|
browseEntries = entries;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
browseError = String(e);
|
browseError = String(e);
|
||||||
browseEntries = [];
|
browseEntries = [];
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,14 @@ async function loadLists() {
|
||||||
async function loadTasks() {
|
async function loadTasks() {
|
||||||
if (!activeListId) return;
|
if (!activeListId) return;
|
||||||
try {
|
try {
|
||||||
tasks = await invoke<Task[]>("list_tasks", { listId: activeListId });
|
const loaded = await invoke<Task[]>("list_tasks", { listId: activeListId });
|
||||||
|
// Deduplicate by task ID — sync conflicts can produce files with the same UUID
|
||||||
|
const seen = new Set<string>();
|
||||||
|
tasks = loaded.filter((t) => {
|
||||||
|
if (seen.has(t.id)) return false;
|
||||||
|
seen.add(t.id);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = String(e);
|
error = String(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue