Skip to content

Commit a1d2657

Browse files
committed
updates
1 parent 5088088 commit a1d2657

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

components/supabase/supabase.app.mjs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default {
6262
verifyForErrors(resp);
6363
return resp;
6464
} catch (error) {
65-
if (attempt >= maxAttempts) {
65+
if (attempt === maxAttempts - 1) {
6666
throw error;
6767
}
6868

@@ -87,12 +87,13 @@ export default {
8787
ascending = args.sortOrder === "ascending",
8888
max,
8989
} = args;
90-
const query = this.baseFilter(client, table, orderBy, ascending, max);
91-
if (filter) {
92-
const filterMethod = this[filter];
93-
filterMethod(query, column, value);
94-
}
95-
const resp = await this.retryWithExponentialBackoff(() => query);
90+
const resp = await this.retryWithExponentialBackoff(
91+
() => this.baseFilter(client, table, orderBy, ascending, max)
92+
.then((q) => {
93+
if (filter) this[filter](q, column, value);
94+
return q;
95+
}),
96+
);
9697
return resp;
9798
},
9899
baseFilter(client, table, orderBy, ascending, max) {

0 commit comments

Comments
 (0)