Skip to content

Commit

Permalink
fix object
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Jan 9, 2025
1 parent 59db7b7 commit 4c7647c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default function Home() {

// posts to all the enabled target platforms
// errors are handled in ComposePost
const post = async (text) => {
const post = async (posts) => {
// TODO: generic interface for external plugins
const promises = [];

if (NEAR_SOCIAL_ENABLED) {
promises.push(postToNearSocial(text));
promises.push(postToNearSocial(posts));
}

if (TWITTER_ENABLED) {
promises.push(tweet(text));
promises.push(tweet(posts));
}

await Promise.all(promises); // execute all postings
Expand Down
1 change: 1 addition & 0 deletions src/services/near-social.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class NearSocialService {
type: "md",
text: combinedText,
};


const transaction = await NearSocialClient.set({
data: {
Expand Down
5 changes: 1 addition & 4 deletions src/store/near-social-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ const store = (set, get) => ({
}

try {
const transaction = await service.createPost({
type: "md",
text: content,
});
const transaction = await service.createPost(content);

if (!transaction) {
throw new Error("Failed to create post transaction");
Expand Down

0 comments on commit 4c7647c

Please sign in to comment.