Skip to content

Commit

Permalink
unhardcode presentation id
Browse files Browse the repository at this point in the history
  • Loading branch information
subhojit777 committed Dec 4, 2020
1 parent 211ad17 commit 240ace5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {instanceOf} from "prop-types";
import WaitMessage from "./components/WaitMessage";
import Presenter from "./components/Presenter";
import {w3cwebsocket as W3CWebSocket} from "websocket";
import queryString from "query-string";

const client = new W3CWebSocket(`${process.env.REACT_APP_WEB_SOCKET_URL}/ws/`);

Expand All @@ -19,8 +20,9 @@ class App extends Component {

const {cookies} = props;

// TODO: Unhardcode the default presentation ID.
this.presentationId = cookies.get('pid') || 2;
const parsedQueryString = queryString.parse(window.location.search);

this.presentationId = parseInt(parsedQueryString.pid) || 1;
this.state = {
token: cookies.get('token') || null,
questions: null,
Expand Down

0 comments on commit 240ace5

Please sign in to comment.