Skip to content

Commit

Permalink
Update react-js and next-js examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pkumar-strivve committed Oct 25, 2024
1 parent d44e5c9 commit 254e4f4
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ CONTRIBUTING.md
.eslintrc
.babelrc
.gitignore
*.tgz
*.iml

# test file
__tests__
Expand Down
18 changes: 9 additions & 9 deletions examples/next-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@strivve/strivve-cx": "^0.1.15",
"@strivve/strivve-cx": "^0.1.24",
"@strivve/strivve-sdk": "^3.3.4",
"@types/node": "18.15.11",
"@types/react": "18.3.5",
Expand Down
53 changes: 36 additions & 17 deletions examples/react-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/react-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@strivve/strivve-cx": "^0.1.12",
"@strivve/strivve-cx": "^0.1.24",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
4 changes: 2 additions & 2 deletions public/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/strivveCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class StrivveCore {
const item = this.jobs?.[jobs.length - 1];

if (!item?.termination_type) {
this.service.cancelJob(item.id);
await this.service.cancelJob(item.id);
this.onMessage(item.id, {
status: 'CANCELLED',
termination_type: 'CANCELLED',
Expand Down
3 changes: 0 additions & 3 deletions src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,14 @@ class StrivveService implements StrivveServiceInterface {
}

async waitForLogin(): Promise<boolean> {
console.log("Inside wait for login");
return new Promise((resolve, reject) => {
const intervalId = setInterval(() => {
if (this.is_login) {
console.log("Succesfully resolved");
clearInterval(intervalId);
resolve(true);
}

if (this.is_error) {
console.log("waitForLogin rejected");
clearInterval(intervalId);
reject('Session expired');
}
Expand Down

0 comments on commit 254e4f4

Please sign in to comment.