Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): scheduled tasks can run on a webhook #15085

Mergedjuliusmarmingemerged 14 commits intomain fromrefs/pull/15085/headmerged by juliusmarminge View on GitHub

Showing 32 changed files with 16 additions and 1 deletion (loading 29).

x
0 of 32 viewed, 32 left
4 additions and 1 deletionapps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsxModified
View file
@@ -87,6 +87,7 @@
] as const;
​
function describeSchedule(task: ScheduledTask): string {
+ if (task.schedule.type === "webhook") return "On webhook";
if (task.schedule.type === "interval") return formatScheduledTaskInterval(task.schedule.everyMs);
const days = task.schedule.weekdays?.length ? repeatLabel(task.schedule.weekdays) : "Every day";
return `${days} at ${formatTime(task.schedule.timeOfDay)}`;
@@ -1024,6 +1025,8 @@
<Pressable
accessibilityRole="button"
accessibilityLabel={`Edit ${task.title}`}
+ // Webhook tasks are not editable here yet; saving would drop their URL.
+ disabled={task.schedule.type === "webhook"}
onPress={() => {
onEdit(task);
@@ -1048,7 +1051,7 @@
</Pressable>
<ControlPillMenu
actions={[
- { id: "edit", title: "Edit" },
+ ...(task.schedule.type === "webhook" ? [] : [{ id: "edit", title: "Edit" }]),
{ id: "toggle", title: task.enabled ? "Pause" : "Resume" },
{ id: "run", title: "Run now" },
{ id: "delete", title: "Delete", attributes: { destructive: true } },