mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
update error message
This commit is contained in:
@@ -22,10 +22,7 @@ export const handleFirestoreError = (
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
error.message.includes("indexes?create_composite=") ||
|
||||
error.message.includes("/firestore/indexes?")
|
||||
) {
|
||||
if (error.message.includes("indexes?create_composite=")) {
|
||||
enqueueSnackbar(
|
||||
"Filtering while having another column sorted requires a new Firestore index",
|
||||
{
|
||||
@@ -47,6 +44,28 @@ export const handleFirestoreError = (
|
||||
return;
|
||||
}
|
||||
|
||||
if (error.message.includes("/firestore/indexes?")) {
|
||||
enqueueSnackbar(
|
||||
"Filtering on a group collection requires a new Firestore index",
|
||||
{
|
||||
variant: "warning",
|
||||
action: (
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
href={"https" + error.message.split("https").pop()}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Create index
|
||||
<InlineOpenInNewIcon style={{ lineHeight: "16px" }} />
|
||||
</Button>
|
||||
),
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (error.code === "invalid-argument") {
|
||||
enqueueSnackbar("Cannot sort by this column with the current set filters", {
|
||||
variant: "error",
|
||||
|
||||
Reference in New Issue
Block a user