-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Massive overhaul and cleanup of how daily smartblocks work (Closes #64)…
… (#81) * Massive overhaul and cleanup of how daily smartblocks work (Closes #64) * allocating daily config methods separately * handle null daily config * transform null to default * Setting enabled toggle * next run tracker * Daily config component next run * Save last run logic * Set only run on this device * 1.4.0
- Loading branch information
1 parent
84cc88a
commit 1ce9c6b
Showing
15 changed files
with
385 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ export const handler: APIGatewayProxyHandler = awsGetRoamJSUser( | |
}) | ||
.promise() | ||
.then(async (r) => { | ||
const existingWorkflow = r.Items.find( | ||
const existingWorkflow = (r.Items || []).find( | ||
(i) => fromStatus(i.status.S) !== "USER" | ||
); | ||
if (existingWorkflow && existingWorkflow?.uuid?.S !== uuid) { | ||
|
@@ -100,7 +100,7 @@ export const handler: APIGatewayProxyHandler = awsGetRoamJSUser( | |
.promise() | ||
.then((a) => a.Item); | ||
const limit = Number(existingAuthor?.limit?.N) || 5; | ||
const putItem = (existingDisplayName: string) => | ||
const putItem = (existingDisplayName = "") => | ||
dynamo | ||
.query({ | ||
TableName: "RoamJSSmartBlocks", | ||
|
@@ -117,7 +117,7 @@ export const handler: APIGatewayProxyHandler = awsGetRoamJSUser( | |
}) | ||
.promise() | ||
.then((qr) => { | ||
return qr.Count >= limit | ||
return (qr.Count || 0) >= limit | ||
? { | ||
statusCode: 401, | ||
body: `Not allowed to publish more than ${limit} workflows. Reach out to [email protected] about increasing your limit.`, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.