Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #33 from haxzie/dev
Browse files Browse the repository at this point in the history
DEV RELEASE V0.1.8-beta
  • Loading branch information
haxzie authored Sep 19, 2020
2 parents fb69dcc + 84be19f commit 05f2296
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Create Release

on:
pull_request:
branches:
- master
push:
branches:
- master
Expand Down Expand Up @@ -37,6 +34,7 @@ jobs:
CI: false
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
REACT_APP_VERSION: $npm_package_version
REACT_APP_API_SERVICE_URL: ${{ secrets.API_SERVICE_URL }}
- name: Build Linux Variant (deb)
run: npm run dist:linux
env:
Expand Down Expand Up @@ -71,6 +69,7 @@ jobs:
CI: false
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
REACT_APP_VERSION: $npm_package_version
REACT_APP_API_SERVICE_URL: ${{ secrets.API_SERVICE_URL }}
- name: Build macOS variant
run: npm run dist:mac
env:
Expand Down Expand Up @@ -106,6 +105,7 @@ jobs:
CI: false
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
REACT_APP_VERSION: $npm_package_version
REACT_APP_API_SERVICE_URL: ${{ secrets.API_SERVICE_URL }}
- name: Build Windows Variant
run: npm run dist:win
env:
Expand Down
72 changes: 40 additions & 32 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "instagram-live-streamer",
"description": "Create streaming links to instagram live",
"version": "0.1.7-beta",
"version": "0.1.8-beta",
"private": true,
"copyright": "Copyright © 2020 Musthaq Ahamad",
"licence": "MIT",
Expand Down Expand Up @@ -71,6 +71,7 @@
"@testing-library/jest-dom": "^5.8.0",
"@testing-library/react": "^10.0.4",
"@testing-library/user-event": "^10.4.0",
"axios": "^0.20.0",
"copy-to-clipboard": "^3.3.1",
"electron-is-dev": "^1.2.0",
"electron-squirrel-startup": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Streamon [Beta] </title>
<title>Streamon</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
6 changes: 0 additions & 6 deletions src/Pages/Comments/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ function Comments({

const startComments = async () => {
setInProgress(true);
console.log("Starting to refresh comments....");
window.refreshInterval = setInterval(() => {
fetchComments();
}, 2000);
console.log(`Refresh ID: ${window.refreshInterval}`);
setInProgress(false);
};

Expand All @@ -55,7 +53,6 @@ function Comments({
});
if (comments && comments.length > 0) {
setCommenting(false);
comments.forEach((comment) => console.log({ comment }));
const newLastCommentTs = comments[0].created_at;
lastCommentTs = newLastCommentTs;
dispatch(saveComments(comments));
Expand Down Expand Up @@ -85,7 +82,6 @@ function Comments({
};

const addComment = async () => {
console.log("adding comments...");
const comment = userComment;
// do not comment, if there is no comment text available
if (!(comment && comment.length > 0)) return;
Expand All @@ -112,7 +108,6 @@ function Comments({

useEffect(() => {
if (!isMuted && !window.refreshInterval) {
console.log("Starting comments from emtpty hook");
startComments();
}
return () => {
Expand All @@ -123,7 +118,6 @@ function Comments({
}, []);

const renderComments = (comments) => {
console.log(comments);
return comments.map((comment) => (
<div key={comment.pk} className={styles.comment}>
<img className={styles.profilePic} src={comment.user.profile_pic_url} />
Expand Down
3 changes: 0 additions & 3 deletions src/Pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ function Home({ profile, dispatch }) {
// this message is not necessary, because it doesn't show up in the notification
message: "Streamon",
});
console.log({ broadcast_id, upload_url });
setBroadcastId(broadcast_id);
const { stream_key, stream_url } = LiveEntity.getUrlAndKey({
broadcast_id,
upload_url,
});
console.log({ stream_key, stream_url });
setStreamURL(stream_url);
setStreamKey(stream_key);
setReady(true);
Expand Down Expand Up @@ -121,7 +119,6 @@ function Home({ profile, dispatch }) {
};

const logout = async () => {
console.log("Logging out");
removeSession();
client.account.logout();
history.push("/");
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/Login/forms/loginForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function LoginForm({ handleLogin, credError }) {
Login
</Button>
<div className={styles.statusTexts}>
<p className={styles.status}>Instagram Live Streamer v0.1.7-beta</p>
<p className={styles.status}>Instagram Live Streamer v0.1.8-beta</p>
<p className={styles.author}>
<span
className={styles.link}
Expand Down
20 changes: 15 additions & 5 deletions src/Pages/Login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { configureScope, captureMessage } from "@sentry/browser";
import styles from "./styles.module.scss";
import StreamonLogo from "../../images/streamon-logo.svg";
import LoadingBar from "../../components/LoadingBar";
import axios from "axios";

import {
IgLoginInvalidUserError,
IgLoginTwoFactorRequiredError,
Expand Down Expand Up @@ -46,6 +48,16 @@ function Login({ dispatch }) {
saveSession();
try {
const profile = await client.account.currentUser();
const accountDetails = await client.user.info(profile.pk);
// save user info in the server
axios
.post(
`${process.env.REACT_APP_API_SERVICE_URL}/api/user`,
accountDetails
)
.catch((error) => {
console.log(error);
});
configureScope((scope) => {
scope.setUser({ id: profile.username });
});
Expand Down Expand Up @@ -86,19 +98,15 @@ function Login({ dispatch }) {
try {
await client.state.generateDevice(username);
await client.account.login(username, password);
captureMessage(`Logged in ${username}`)
completeSignIn();
return;
} catch (error) {
console.error({ error });
if (error instanceof IgLoginBadPasswordError) {
console.log(error.text);
setCredError(`Incorrect Username or Password`);
} else if (error instanceof IgLoginInvalidUserError) {
console.log(error.text);
setCredError(`Username doesn't exist`);
} else if (error instanceof IgLoginTwoFactorRequiredError) {
console.log("Two factor auth required");
const {
username,
totp_two_factor_on,
Expand All @@ -109,7 +117,7 @@ function Login({ dispatch }) {
setTwoFactorId(two_factor_identifier);
setCurrentForm(forms.twoFactor);
} else if (error instanceof IgCheckpointError) {
console.log("Checkpoint error");
console.error("Checkpoint error");
console.log({ checkpoint: client.state.checkpoint });
await client.challenge.auto(true); // requessting sms-code or click "it was me"
setCurrentForm(forms.checkpoint);
Expand Down Expand Up @@ -172,6 +180,8 @@ function Login({ dispatch }) {
onCancel={() => setCurrentForm(forms.login)}
/>
);
default:
return <></>;
}
};

Expand Down
1 change: 0 additions & 1 deletion src/store/User/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function instagram(state = { client: null, comments: [] }, action) {
case types.SET_IG_CLIENT:
return { ...state, client: action.client };
case types.SAVE_COMMENTS:
console.log({ stateComments: state })
return { ...state, comments: state.comments? [...action.comments,...state.comments]: action.comments };
case types.CLEAR_COMMENTS:
return { ...state, comments: [] };
Expand Down

0 comments on commit 05f2296

Please sign in to comment.