Skip to content
Snippets Groups Projects
Commit 953a69ab authored by Simon Künzel's avatar Simon Künzel
Browse files

Fix #64 Conflict resolution is shown for any error

parent a5a72365
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ import type { ...@@ -10,6 +10,7 @@ import type {
int, int,
} from "@/videoag/api/types"; } from "@/videoag/api/types";
import { useApi } from "@/videoag/api/ApiProvider"; import { useApi } from "@/videoag/api/ApiProvider";
import { ApiError } from "@/videoag/api/ApiError";
import { showError, showErrorToast } from "@/videoag/error/ErrorDisplay"; import { showError, showErrorToast } from "@/videoag/error/ErrorDisplay";
import { useLanguage } from "@/videoag/localization/LanguageProvider"; import { useLanguage } from "@/videoag/localization/LanguageProvider";
import { useReloadBoundary } from "@/videoag/miscellaneous/ReloadBoundary"; import { useReloadBoundary } from "@/videoag/miscellaneous/ReloadBoundary";
...@@ -585,9 +586,16 @@ export function OMEdit({ ...@@ -585,9 +586,16 @@ export function OMEdit({
}) })
.catch((err) => { .catch((err) => {
console.error(err, "Unable to update object"); console.error(err, "Unable to update object");
if (
err instanceof ApiError &&
err.error_code === "modification_unexpected_current_value"
) {
setShowConfigModal(false); setShowConfigModal(false);
setInConflictResolution((x) => x + 1); setInConflictResolution((x) => x + 1);
setUpdatesToBeResolved(updates); setUpdatesToBeResolved(updates);
} else {
showError(err);
}
}); });
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment