Fixed bugs found in QA

This commit is contained in:
Logan Allen 2019-06-27 13:56:51 -07:00 committed by Isaac Visintainer
parent 50d9ffd7ab
commit e69f51acb1
3 changed files with 129 additions and 87 deletions

View File

@ -270,11 +270,21 @@
|= [shp=@p stat=status:hall] |= [shp=@p stat=status:hall]
shp shp
(~(put by acc) cir newset) (~(put by acc) cir newset)
:- ~ ~& nes.piz
%= this =/ str
messages.str.sta (~(put by messages) circle nes.piz) %= str.sta
peers.str.sta (~(uni by peers.str.sta) (~(put by peers) circle localpeers)) messages (~(put by messages) circle nes.piz)
== peers (~(uni by peers.str.sta) (~(put by peers) circle localpeers))
==
=/ messageupdate/update
:* %messages
circle
0
(lent messages)
nes.piz
==
:- (send-chat-update [messageupdate str])
this(str.sta str)
== ==
:: ::
:: +diff-hall-rumor: handle updates to hall state :: +diff-hall-rumor: handle updates to hall state
@ -319,7 +329,10 @@
?> ?=(%gram -.sto) ?> ?=(%gram -.sto)
=* messages messages.str.sta =* messages messages.str.sta
=/ circle/circle:hall [`@p`(slav %p &2:wir) &3:wir] =/ circle/circle:hall [`@p`(slav %p &2:wir) &3:wir]
=/ nes/(list envelope:hall) (~(got by messages) circle) =/ unes/(unit (list envelope:hall)) (~(get by messages) circle)
?~ unes
[~ this]
=/ nes u.unes
=/ str %= str.sta =/ str %= str.sta
messages (~(put by messages) circle (snoc nes nev.sto)) messages (~(put by messages) circle (snoc nes nev.sto))
== ==
@ -392,8 +405,8 @@
[~ this] [~ this]
=* affectedcir cir.src.dif.sto =* affectedcir cir.src.dif.sto
=/ newwir/wire =/ newwir/wire
/circle/[(scot %p hos.affectedcir)]/[nom.affectedcir]/grams/config/group /circle/[(scot %p hos.affectedcir)]/[nom.affectedcir]/grams/0/config/group
=/ pat/path /circle/[nom.affectedcir]/grams/config/group =/ pat/path /circle/[nom.affectedcir]/grams/0/config/group
:: we've added a source to our inbox :: we've added a source to our inbox
:: ::
?: add.dif.sto ?: add.dif.sto
@ -424,7 +437,9 @@
%= str.sta %= str.sta
inbox newinbox inbox newinbox
:: ::
configs (~(del by configs.str.sta) affectedcir) configs (~(del by configs.str.sta) affectedcir)
messages (~(del by messages.str.sta) affectedcir)
peers (~(del by peers.str.sta) affectedcir)
== ==
=/ fakecir/circle:hall =/ fakecir/circle:hall
:- our.bol :- our.bol

View File

@ -17,10 +17,6 @@
return module = { exports: {} }, fn(module, module.exports), module.exports; return module = { exports: {} }, fn(module, module.exports), module.exports;
} }
function getCjsExportFromNamespace (n) {
return n && n.default || n;
}
/* /*
object-assign object-assign
(c) Sindre Sorhus (c) Sindre Sorhus
@ -45855,7 +45851,7 @@
reduceCircles(circles, state) { reduceCircles(circles, state) {
if (circles) { if (circles) {
state.circles = circles; state.circles = circles.circles;
} }
} }
@ -45868,7 +45864,8 @@
reduceDelete(del, state) { reduceDelete(del, state) {
if (del) { if (del) {
delete state.configs[del.circle]; delete state.configs[del.circle];
state.messages[del.circle] = []; delete state.messages[del.circle];
delete state.peers[del.circle];
} }
} }
@ -45900,8 +45897,6 @@
handleEvent(data) { handleEvent(data) {
let json = data.data; let json = data.data;
console.log(json);
this.initialReducer.reduce(json, this.state); this.initialReducer.reduce(json, this.state);
this.configReducer.reduce(json, this.state); this.configReducer.reduce(json, this.state);
this.updateReducer.reduce(json, this.state); this.updateReducer.reduce(json, this.state);
@ -47901,8 +47896,6 @@
isBuffer: isBuffer isBuffer: isBuffer
}); });
var require$$0 = getCjsExportFromNamespace(bufferEs6);
var bn = createCommonjsModule(function (module) { var bn = createCommonjsModule(function (module) {
(function (module, exports) { (function (module, exports) {
@ -47955,7 +47948,7 @@
var Buffer; var Buffer;
try { try {
Buffer = require$$0.Buffer; Buffer = bufferEs6.Buffer;
} catch (e) { } catch (e) {
} }
@ -56740,12 +56733,47 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {
invites: []
};
this.setInvitesToReadInterval = setInterval( this.setInvitesToReadInterval = setInterval(
this.setInvitesToRead.bind(this), this.setInvitesToRead.bind(this),
1000 1000
); );
} }
componentDidMount() {
this.filterInvites();
}
componentDidUpdate(prevProps, prevState) {
if (prevProps !== this.props) {
this.filterInvites();
}
}
filterInvites() {
const { props } = this;
let invites = [];
let filterInvites = {};
props.invites.forEach((msg) => {
let uid = lodash.get(msg, 'gam.sep.ire.top', false);
if (!uid) {
invites.push(msg.gam);
} else {
filterInvites[uid] = true;
}
});
invites = invites.filter((msg) => {
return !(msg.uid in filterInvites);
});
this.setState({ invites });
}
componentWillUnmount() { componentWillUnmount() {
if (this.setInvitesToReadInterval) { if (this.setInvitesToReadInterval) {
clearInterval(this.setInvitesToReadInterval); clearInterval(this.setInvitesToReadInterval);
@ -56754,14 +56782,21 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
} }
setInvitesToRead() { setInvitesToRead() {
const { props } = this; const { props, state } = this;
if ( if (
props.inviteConfig && props.inviteConfig &&
'red' in props.inviteConfig && 'red' in props.inviteConfig &&
props.invites.length > 0 && props.invites.length > 0
props.inviteConfig.red < (props.invites[props.invites.length - 1].num + 1)
) { ) {
props.api.read('i', props.invites[props.invites.length - 1].num + 1); let invNum = (props.invites[props.invites.length - 1].num + 1);
if (
props.inviteConfig.red < invNum &&
(invNum - props.inviteConfig.red) > state.invites.length
) {
props.api.read('i', invNum - state.invites.length);
}
} }
} }
@ -56770,7 +56805,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
} }
render() { render() {
const { props } = this; const { props, state } = this;
let station = props.match.params.ship + '/' + props.match.params.station; let station = props.match.params.ship + '/' + props.match.params.station;
let sidebarItems = props.circles let sidebarItems = props.circles
@ -56815,45 +56850,31 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
ship: obj.aut, ship: obj.aut,
selected: obj.selected, selected: obj.selected,
unread: unread, unread: unread,
history: props.history, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 82}} history: props.history, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 124}}
) )
); );
}); });
let invites = []; let inviteItems = state.invites.map((inv) => {
let filterInvites = {};
props.invites.forEach((msg) => {
let uid = lodash.get(msg, 'gam.sep.ire.top', false);
if (!uid) {
invites.push(msg.gam);
} else {
filterInvites[uid] = true;
}
});
let inviteItems = invites.filter((msg) => {
return !(msg.uid in filterInvites);
}).map((inv) => {
return ( return (
react.createElement(SidebarInvite, { react.createElement(SidebarInvite, {
key: inv.uid, key: inv.uid,
msg: inv, msg: inv,
api: props.api, api: props.api,
config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 112}} config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 140}}
) )
); );
}); });
return ( return (
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 122}} react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 150}}
, react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 123}} , react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 151}}
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 124}}, "Chat") , react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 152}}, "Chat")
, react.createElement('a', { , react.createElement('a', {
className: "dib tr w-50 pointer plus-font" , className: "dib tr w-50 pointer plus-font" ,
onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 125}}, "+") onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 153}}, "+")
) )
, react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 129}} , react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 157}}
, inviteItems , inviteItems
, sidebarItems , sidebarItems
) )
@ -57271,6 +57292,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
componentDidMount() { componentDidMount() {
this.updateNumPeople(); this.updateNumPeople();
this.updateReadNumber();
} }
componentWillUnMount() { componentWillUnMount() {
@ -57299,6 +57321,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}, () => { }, () => {
this.updateNumPeople(); this.updateNumPeople();
this.scrollToBottom(); this.scrollToBottom();
this.updateReadNumber();
}); });
} else if (!(state.station in props.configs)) { } else if (!(state.station in props.configs)) {
props.history.push('/~chat'); props.history.push('/~chat');
@ -57391,7 +57414,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
return ( return (
react.createElement('a', { react.createElement('a', {
className: "vanilla hoverline text-600 text-mono" , className: "vanilla hoverline text-600 text-mono" ,
href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 157}} href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 159}}
, prettyShip(`~${msg.gam.aut}`)[0] , prettyShip(`~${msg.gam.aut}`)[0]
) )
); );
@ -57401,7 +57424,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
react.createElement(Message, { react.createElement(Message, {
key: msg.gam.uid + Math.random(), key: msg.gam.uid + Math.random(),
msg: msg.gam, msg: msg.gam,
details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 166}} ) details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 168}} )
); );
} }
@ -57423,18 +57446,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
return ( return (
react.createElement('div', { key: state.station, react.createElement('div', { key: state.station,
className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 190}} className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 192}}
, react.createElement('div', { className: "pl2 pt2 bb" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 192}} , react.createElement('div', { className: "pl2 pt2 bb" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 194}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 193}}, state.circle) , react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 195}}, state.circle)
, react.createElement(ChatTabBar, { ...props, , react.createElement(ChatTabBar, { ...props,
station: state.station, station: state.station,
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 194}} ) numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 196}} )
) )
, react.createElement('div', { , react.createElement('div', {
className: "overflow-y-scroll pt3 flex flex-column-reverse" , className: "overflow-y-scroll pt3 flex flex-column-reverse" ,
style: { height: 'calc(100% - 157px)' }, style: { height: 'calc(100% - 157px)' },
onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 198}} onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 200}}
, react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 202}}) , react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 204}})
, chatMessages , chatMessages
) )
, react.createElement(ChatInput, { , react.createElement(ChatInput, {
@ -57442,7 +57465,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
numMsgs: lastMsgNum, numMsgs: lastMsgNum,
station: state.station, station: state.station,
circle: state.circle, circle: state.circle,
placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 205}} ) placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 207}} )
) )
) )
} }
@ -57637,6 +57660,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
}; };
} }
componentDidUpdate(prevProps, prevState) {
const { props, state } = this;
if (!!state.isLoading && !props.circles.includes(state.station)) {
this.setState({
isLoading: false
}, () => {
props.history.push('/~chat');
});
}
}
deleteChat() { deleteChat() {
const { props, state } = this; const { props, state } = this;
if (state.host === `~${window.ship}`) { if (state.host === `~${window.ship}`) {
@ -57671,48 +57705,42 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
let peers = props.peers[state.station] || [window.ship]; let peers = props.peers[state.station] || [window.ship];
if (!!state.isLoading) { if (!!state.isLoading) {
console.log(props.circles);
if (!props.circles.contains(state.station)) {
props.history.push('/~chat');
}
return ( return (
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 60}} react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 65}}
, react.createElement('div', { className: "pl2 pt2 bb mb3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 61}} , react.createElement('div', { className: "pl2 pt2 bb mb3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 66}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 62}}, state.circle) , react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 67}}, state.circle)
, react.createElement(ChatTabBar, { , react.createElement(ChatTabBar, {
...props, ...props,
station: state.station, station: state.station,
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 63}} ) numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 68}} )
) )
, react.createElement('div', { className: "w-100 cf pa3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 68}} , react.createElement('div', { className: "w-100 cf pa3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 73}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 69}}, "Deleting...") , react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 74}}, "Deleting...")
) )
) )
); );
} }
return ( return (
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 76}} react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 81}}
, react.createElement('div', { className: "pl2 pt2 bb mb3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 77}} , react.createElement('div', { className: "pl2 pt2 bb mb3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 82}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 78}}, state.circle) , react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 83}}, state.circle)
, react.createElement(ChatTabBar, { , react.createElement(ChatTabBar, {
...props, ...props,
station: state.station, station: state.station,
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 79}} ) numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 84}} )
) )
, react.createElement('div', { className: "w-100 cf pa3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 84}} , react.createElement('div', { className: "w-100 cf pa3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 89}}
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 85}}, "Settings") , react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$f, lineNumber: 90}}, "Settings")
, react.createElement('div', { className: "w-50 fl pl2 mt3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 86}} , react.createElement('div', { className: "w-50 fl pl2 mt3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 91}}
, react.createElement('p', { className: "body-regular", __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 87}}, "Delete Chat" ) , react.createElement('p', { className: "body-regular", __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 92}}, "Delete Chat" )
, react.createElement('p', { className: "label-regular gray mb3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 88}}, "Permanently delete this chat." , react.createElement('p', { className: "label-regular gray mb3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 93}}, "Permanently delete this chat."
) )
, react.createElement('a', { onClick: this.deleteChat.bind(this), , react.createElement('a', { onClick: this.deleteChat.bind(this),
className: "pointer btn-font underline nice-red" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 91}}, "-> Delete" ) className: "pointer btn-font underline nice-red" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 96}}, "-> Delete" )
) )
, react.createElement('div', { className: "w-50 fr pr2 mt3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 94}} , react.createElement('div', { className: "w-50 fr pr2 mt3" , __self: this, __source: {fileName: _jsxFileName$f, lineNumber: 99}}
) )
) )

View File

@ -19323,7 +19323,6 @@
render() { render() {
const { state } = this; const { state } = this;
let inviteNum = 0; let inviteNum = 0;
let msgNum = 0; let msgNum = 0;
let inviteCircle = `~${window.ship}/i`; let inviteCircle = `~${window.ship}/i`;
@ -19342,9 +19341,9 @@
let host = key.split('/')[0]; let host = key.split('/')[0];
if (!state.configs[key]) { break; } if (!state.configs[key]) { break; }
if (!(key in numbers)) { break; }
let red = state.configs[key].red; let red = state.configs[key].red;
console.log(key, red, numbers[key]);
if (key === inviteCircle) { if (key === inviteCircle) {
inviteNum = inviteNum - red + numbers[key]; inviteNum = inviteNum - red + numbers[key];
@ -19357,19 +19356,19 @@
} }
return ( return (
react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 69}} react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 68}}
, react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 70}} , react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 69}}
, react.createElement('p', { className: "gray", style: { , react.createElement('p', { className: "gray", style: {
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 14, fontSize: 14,
lineHeight: '24px' lineHeight: '24px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 71}}, "Chat") }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 70}}, "Chat")
, react.createElement('img', { , react.createElement('img', {
className: "absolute", className: "absolute",
style: { left: 68, top: 65 }, style: { left: 68, top: 65 },
src: "/~chat/img/Tile.png", src: "/~chat/img/Tile.png",
width: 106, width: 106,
height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 76}} ) height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 75}} )
, react.createElement('p', { , react.createElement('p', {
className: "absolute white" , className: "absolute white" ,
style: { style: {
@ -19377,7 +19376,7 @@
fontWeight: 600, fontWeight: 600,
fontSize: 16, fontSize: 16,
lineHeight: '20px' lineHeight: '20px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 82}}, inviteNum, " invites" ) }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 81}}, inviteNum, " invites" )
, react.createElement('p', { , react.createElement('p', {
className: "absolute white" , className: "absolute white" ,
style: { style: {
@ -19385,7 +19384,7 @@
fontWeight: 600, fontWeight: 600,
fontSize: 16, fontSize: 16,
lineHeight: '20px' lineHeight: '20px'
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 90}}, msgNum, " new messages" ) }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 89}}, msgNum, " new messages" )
) )
) )
); );