Try re-post if idempotency key fails
This commit is contained in:
parent
17334de24a
commit
efa4ba63eb
1 changed files with 8 additions and 3 deletions
|
@ -816,9 +816,14 @@ function Compose({
|
||||||
skipThreading: true,
|
skipThreading: true,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
newStatus = await masto.v1.statuses.create(params, {
|
newStatus = await masto.v1.statuses.create(params, {
|
||||||
idempotencyKey: UID.current,
|
idempotencyKey: UID.current,
|
||||||
});
|
});
|
||||||
|
} catch (_) {
|
||||||
|
// If idempotency key fails, try again without it
|
||||||
|
newStatus = await masto.v1.statuses.create(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setUIState('default');
|
setUIState('default');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue