- { !live &&
}
- { live && (
+ { live &&
}
+ { !live && (
<>
diff --git a/frontend/app/duck/sessions.js b/frontend/app/duck/sessions.js
index 726b9250e..54bab17b2 100644
--- a/frontend/app/duck/sessions.js
+++ b/frontend/app/duck/sessions.js
@@ -20,6 +20,7 @@ const REDEFINE_TARGET = 'sessions/REDEFINE_TARGET';
const SET_TIMEZONE = 'sessions/SET_TIMEZONE';
const SET_EVENT_QUERY = 'sessions/SET_EVENT_QUERY';
const SET_AUTOPLAY_VALUES = 'sessions/SET_AUTOPLAY_VALUES';
+const TOGGLE_CHAT_WINDOW = 'sessions/TOGGLE_CHAT_WINDOW';
const SET_ACTIVE_TAB = 'sessions/SET_ACTIVE_TAB';
@@ -36,7 +37,9 @@ const initialState = Map({
errorStack: List(),
eventsIndex: [],
sourcemapUploaded: true,
- filteredEvents: null
+ filteredEvents: null,
+ showChatWindow: false,
+ liveSessions: List()
});
const reducer = (state = initialState, action = {}) => {
@@ -50,6 +53,11 @@ const reducer = (state = initialState, action = {}) => {
: state;
case FETCH_ERROR_STACK.SUCCESS:
return state.set('errorStack', List(action.data.trace).map(ErrorStack)).set('sourcemapUploaded', action.data.sourcemapUploaded)
+ case FETCH_LIVE_LIST.SUCCESS:
+ // const { sessions, total } = action.data;
+ const liveList = List(action.data).map(Session);
+ return state
+ .set('liveSessions', liveList)
case FETCH_LIST.SUCCESS:
const { sessions, total } = action.data;
const list = List(sessions).map(Session);
@@ -99,8 +107,7 @@ const reducer = (state = initialState, action = {}) => {
.set('sessionIds', list.map(({ sessionId }) => sessionId ).toJS())
.set('total', total)
.set('keyMap', keyMap)
- .set('wdTypeCount', wdTypeCount);
-
+ .set('wdTypeCount', wdTypeCount);
case SET_AUTOPLAY_VALUES: {
const sessionIds = state.get('sessionIds')
const currentSessionId = state.get('current').sessionId
@@ -195,6 +202,9 @@ const reducer = (state = initialState, action = {}) => {
.set('sessionIds', allList.map(({ sessionId }) => sessionId ).toJS())
case SET_TIMEZONE:
return state.set('timezone', action.timezone)
+ case TOGGLE_CHAT_WINDOW:
+ console.log(action)
+ return state.set('showChatWindow', action.state)
default:
return state;
}
@@ -256,7 +266,14 @@ export function fetchFavoriteList() {
export function fetchLiveList() {
return {
types: FETCH_LIVE_LIST.toArray(),
- call: client => client.get('/sessions2/favorite'),
+ call: client => client.get('/assist/sessions'),
+ };
+}
+
+export function toggleChatWindow(state) {
+ return {
+ type: TOGGLE_CHAT_WINDOW,
+ state
};
}
diff --git a/frontend/app/player/MessageDistributor/MessageDistributor.ts b/frontend/app/player/MessageDistributor/MessageDistributor.ts
index 276ace503..1c2ee0a2e 100644
--- a/frontend/app/player/MessageDistributor/MessageDistributor.ts
+++ b/frontend/app/player/MessageDistributor/MessageDistributor.ts
@@ -147,7 +147,7 @@ export default class MessageDistributor extends StatedScreen {
this.peer = peer;
peer.on("open", me => {
console.log("peer opened", me);
- const id = `Amva-sf98-234fd-OR-test-${this.session.sessionId}`;
+ const id = `3sWXSsqHgSKnEO5YkNJK-${this.session.sessionId}`;
console.log("trying to connect to", id)
const conn = peer.connect(id);
conn.on('open', () => {
@@ -179,7 +179,7 @@ export default class MessageDistributor extends StatedScreen {
callPeer(localStream: MediaStream, cb: (s: MediaStream)=>void): boolean {
if (!this.peer) { return false; }
- const conn = this.peer.connections[`Amva-sf98-234fd-OR-test-${this.session.sessionId}`]?.[0];
+ const conn = this.peer.connections[`3sWXSsqHgSKnEO5YkNJK-${this.session.sessionId}`]?.[0];
if (!conn || !conn.open) { return false; } // Conn not established
const call = this.peer.call(conn.peer, localStream);
console.log('calling...')
diff --git a/frontend/app/types/session/session.js b/frontend/app/types/session/session.js
index 132afcc7d..f5d10ce60 100644
--- a/frontend/app/types/session/session.js
+++ b/frontend/app/types/session/session.js
@@ -26,7 +26,7 @@ function hashString(s: string): number {
export default Record({
sessionId: '',
siteId: '',
- live: false,
+ live: true,
startedAt: 0,
duration: 0,
events: List(),
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index 53a66aa44..2058dcc16 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -1,6 +1,7 @@
const colors = require('./app/theme/colors');
module.exports = {
+ important: true,
purge: [],
corePlugins: [
'preflight',
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 696c03d84..e2b8fa997 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -16,7 +16,11 @@
"Appo": ["./app"],
"Types": ["./app/types" ],
"Types/*": ["./app/types/*"], // Sublime hack
- "UI": ["./app/components/ui"]
+ "UI": ["./app/components/ui"],
+ "Duck": ["./app/duck"],
+ "Duck/*": ["./app/duck/*"],
+ "Shared": ["./app/components/shared"],
+ "Shared/*": ["./app/components/shared/*"],
}
},
"exclude": [