mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
Tile is finished, invite counts function correctly. Safari rendering bug of tile. Message counts update improperly and need their own circle
This commit is contained in:
parent
35d4d138f3
commit
d47b48d60a
@ -29,26 +29,41 @@ export class SidebarInvite extends Component {
|
||||
updateInvite(uid, cir, resp) {
|
||||
let tagstring = resp ? "Accept" : "Reject";
|
||||
|
||||
let msg = {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
}
|
||||
console.log(this.props.config);
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: [{
|
||||
source: {
|
||||
nom: "inbox",
|
||||
sub: resp,
|
||||
srs: [cir]
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
this.props.api.hall({
|
||||
phrase: msg
|
||||
},
|
||||
{
|
||||
phrase: {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
read: {
|
||||
nom: 'i',
|
||||
red: this.props.config.red + 2
|
||||
}
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
||||
this.props.api.source(cir, resp);
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -57,7 +72,7 @@ export class SidebarInvite extends Component {
|
||||
let cir = _.get(props, 'msg.sep.inv.cir', false);
|
||||
let aut = _.get(props, 'msg.aut', false);
|
||||
|
||||
if (!aut || !cir) {
|
||||
if (!aut || !cir || !props.config) {
|
||||
return (
|
||||
<div></div>
|
||||
);
|
||||
|
@ -37,6 +37,7 @@ export class Root extends Component {
|
||||
const { props, state } = this;
|
||||
|
||||
let configs = !!state.configs ? state.configs : {};
|
||||
|
||||
let circles = Object.keys(configs).filter((conf) => {
|
||||
if (!configs[conf]) {
|
||||
return false;
|
||||
@ -50,7 +51,7 @@ export class Root extends Component {
|
||||
Object.keys(messages).forEach((stat) => {
|
||||
let arr = messages[stat];
|
||||
if (arr.length === 0) {
|
||||
messagePreviews[stat] = null;
|
||||
messagePreviews[stat] = false;
|
||||
} else {
|
||||
messagePreviews[stat] = arr[arr.length - 1];
|
||||
}
|
||||
@ -58,7 +59,7 @@ export class Root extends Component {
|
||||
|
||||
let unreads = {};
|
||||
circles.forEach((cir) => {
|
||||
if (cir in messagePreviews) {
|
||||
if (cir in messagePreviews && !!messagePreviews[cir]) {
|
||||
unreads[cir] = state.configs[cir].red < messagePreviews[cir].num;
|
||||
} else {
|
||||
unreads[cir] = false;
|
||||
@ -72,6 +73,11 @@ export class Root extends Component {
|
||||
invites = [];
|
||||
}
|
||||
|
||||
let inviteConfig = false;
|
||||
if (`~${window.ship}/i` in configs) {
|
||||
inviteConfig = configs[`~${window.ship}/i`];
|
||||
}
|
||||
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<div>
|
||||
@ -86,6 +92,7 @@ export class Root extends Component {
|
||||
invites={invites}
|
||||
unreads={unreads}
|
||||
api={api}
|
||||
inviteConfig={inviteConfig}
|
||||
{...props}
|
||||
/>
|
||||
}>
|
||||
@ -110,6 +117,7 @@ export class Root extends Component {
|
||||
invites={invites}
|
||||
unreads={unreads}
|
||||
api={api}
|
||||
inviteConfig={inviteConfig}
|
||||
{...props}
|
||||
/>
|
||||
}>
|
||||
@ -136,6 +144,7 @@ export class Root extends Component {
|
||||
invites={invites}
|
||||
unreads={unreads}
|
||||
api={api}
|
||||
inviteConfig={inviteConfig}
|
||||
{...props}
|
||||
/>
|
||||
}>
|
||||
@ -161,6 +170,7 @@ export class Root extends Component {
|
||||
invites={invites}
|
||||
unreads={unreads}
|
||||
api={api}
|
||||
inviteConfig={inviteConfig}
|
||||
{...props}
|
||||
/>
|
||||
}>
|
||||
@ -183,6 +193,7 @@ export class Root extends Component {
|
||||
invites={invites}
|
||||
unreads={unreads}
|
||||
api={api}
|
||||
inviteConfig={inviteConfig}
|
||||
{...props}
|
||||
/>
|
||||
}>
|
||||
|
@ -17,7 +17,7 @@ export class Sidebar extends Component {
|
||||
render() {
|
||||
const { props } = this;
|
||||
let station = props.match.params.ship + '/' + props.match.params.station;
|
||||
|
||||
|
||||
let sidebarItems = props.circles.map((cir) => {
|
||||
let msg = props.messagePreviews[cir];
|
||||
let parsed = !!msg ? getMessageContent(msg.gam) : {
|
||||
@ -75,12 +75,16 @@ export class Sidebar extends Component {
|
||||
return !(msg.uid in filterInvites);
|
||||
}).map((inv) => {
|
||||
return (
|
||||
<SidebarInvite key={inv.uid} msg={inv} api={props.api} />
|
||||
<SidebarInvite
|
||||
key={inv.uid}
|
||||
msg={inv}
|
||||
api={props.api}
|
||||
config={props.inviteConfig}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
<div className="h-100 w-100 overflow-x-hidden flex flex-column">
|
||||
<div className="pl3 pr3 pt3 pb3 cf">
|
||||
<p className="dib w-50 fw-bold body-large">Chat</p>
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import _ from 'lodash';
|
||||
|
||||
|
||||
export default class ChatTile extends Component {
|
||||
@ -7,35 +8,86 @@ export default class ChatTile extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
let numbers = _.get(props, 'data.numbers.chat.numbers', false);
|
||||
let configs = _.get(props, 'data.config.chat.configs', false);
|
||||
|
||||
this.state = {
|
||||
configs: null,
|
||||
messages: null,
|
||||
message: null
|
||||
configs,
|
||||
numbers
|
||||
};
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { props, state } = this;
|
||||
if (prevProps !== props) {
|
||||
|
||||
// TODO: reducer logic :(
|
||||
|
||||
this.setState(props);
|
||||
let numbers = _.get(props, 'data.numbers.chat.numbers', false);
|
||||
let configs = _.get(props, 'data.config.chat.configs', false);
|
||||
|
||||
this.setState({
|
||||
configs,
|
||||
numbers
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log(this.state);
|
||||
const { state } = this;
|
||||
|
||||
let inviteNum = 0;
|
||||
let msgNum = 0;
|
||||
let inviteCircle = `~${window.ship}/i`;
|
||||
|
||||
if (state.numbers && state.configs) {
|
||||
let numbers = {};
|
||||
|
||||
state.numbers.forEach((num) => {
|
||||
numbers[num.circle] = num.length;
|
||||
});
|
||||
|
||||
Object.keys(state.configs).forEach((key) => {
|
||||
let con = state.configs[key];
|
||||
|
||||
if (key in numbers) {
|
||||
console.log(key, con.red, numbers[key]);
|
||||
if (key === inviteCircle) {
|
||||
if (con.red < numbers[key]) {
|
||||
inviteNum = msgNum + numbers[key] - con.red;
|
||||
}
|
||||
} else {
|
||||
if (con.red < numbers[key]) {
|
||||
msgNum = msgNum + numbers[key] - con.red;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-dark-gray w-100 h-100">
|
||||
<a className="w-100 h-100 db" style={{
|
||||
paddingTop: 68,
|
||||
paddingBottom: 68,
|
||||
paddingLeft: 64,
|
||||
paddingRight: 64
|
||||
}}
|
||||
href="/~chat">
|
||||
<img src="/~chat/img/Tile.png" width={106} height={98} />
|
||||
<div className="w-100 h-100 relative" style={{ background: '#1a1a1a' }}>
|
||||
<a className="w-100 h-100 db pa2 no-underline" href="/~chat">
|
||||
<p className="gray">Chat</p>
|
||||
<img
|
||||
className="absolute"
|
||||
style={{ left: 68, top: 65 }}
|
||||
src="/~chat/img/Tile.png"
|
||||
width={106}
|
||||
height={98} />
|
||||
<p
|
||||
className="absolute white"
|
||||
style={{
|
||||
top: 180,
|
||||
fontWeight: 600,
|
||||
fontSize: 16,
|
||||
lineHeight: '20px'
|
||||
}}>{inviteNum} invites</p>
|
||||
<p
|
||||
className="absolute white"
|
||||
style={{
|
||||
top: 207,
|
||||
fontWeight: 600,
|
||||
fontSize: 16,
|
||||
lineHeight: '20px'
|
||||
}}>{msgNum} new messages</p>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
|
@ -69,19 +69,26 @@
|
||||
::
|
||||
::
|
||||
::
|
||||
++ peer-chattile
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
++ construct-tile-json
|
||||
|= str=streams
|
||||
^- json
|
||||
=/ numbers/(list [circle:hall @ud])
|
||||
%+ turn ~(tap by messages.str.sta)
|
||||
%+ turn ~(tap by messages.str)
|
||||
|= [cir=circle:hall lis=(list envelope:hall)]
|
||||
^- [circle:hall @ud]
|
||||
[cir (lent lis)]
|
||||
=/ maptjson *(map @t json)
|
||||
=. maptjson
|
||||
(~(put by maptjson) 'config' (config-to-json str))
|
||||
=. maptjson
|
||||
(~(put by maptjson) 'numbers' (numbers-to-json numbers))
|
||||
[%o maptjson]
|
||||
::
|
||||
++ peer-chattile
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
:_ this
|
||||
:~
|
||||
[ost.bol %diff %json (config-to-json str.sta)]
|
||||
[ost.bol %diff %json (numbers-to-json numbers)]
|
||||
==
|
||||
[ost.bol %diff %json (construct-tile-json str.sta)]~
|
||||
::
|
||||
:: +peer-messages: subscribe to subset of messages and updates
|
||||
::
|
||||
@ -141,16 +148,21 @@
|
||||
:: +send-chat-update: utility func for sending updates to all our subscribers
|
||||
::
|
||||
++ send-chat-update
|
||||
|= upd=update
|
||||
|= [upd=update str=streams]
|
||||
^- (list move)
|
||||
%+ weld
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %chat-update upd]
|
||||
=/ updates/(list move)
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %chat-update upd]
|
||||
::
|
||||
%+ turn (prey:pubsub:userlib /chattile bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %chat-update upd]
|
||||
=/ tile-updates/(list move)
|
||||
%+ turn (prey:pubsub:userlib /chattile bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %json (construct-tile-json str)]
|
||||
::
|
||||
%+ weld
|
||||
updates
|
||||
tile-updates
|
||||
::
|
||||
::
|
||||
:: +hall arms
|
||||
@ -170,10 +182,11 @@
|
||||
::
|
||||
%circles
|
||||
?> ?=(%circles -.piz)
|
||||
:- (send-chat-update [%circles cis.piz])
|
||||
%= this
|
||||
circles.str.sta cis.piz
|
||||
=/ str %= str.sta
|
||||
circles cis.piz
|
||||
==
|
||||
:- (send-chat-update [[%circles cis.piz] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
:: %circle wire
|
||||
::
|
||||
@ -273,19 +286,19 @@
|
||||
:: %circles
|
||||
%circles
|
||||
?> ?=(%circles -.rum)
|
||||
?: add.rum
|
||||
=/ cis (~(put in circles.str.sta) cir.rum)
|
||||
:- (send-chat-update [%circles cis])
|
||||
%= this
|
||||
circles.str.sta cis
|
||||
peers.str.sta (~(put by peers.str.sta) [our.bol cir.rum] ~)
|
||||
==
|
||||
=/ cis (~(del in circles.str.sta) cir.rum)
|
||||
:- (send-chat-update [%circles cis])
|
||||
%= this
|
||||
circles.str.sta cis
|
||||
peers.str.sta (~(del by peers.str.sta) [our.bol cir.rum])
|
||||
=/ cis
|
||||
?: add.rum
|
||||
(~(put in circles.str.sta) cir.rum)
|
||||
(~(del in circles.str.sta) cir.rum)
|
||||
=/ str %= str.sta
|
||||
circles cis
|
||||
peers
|
||||
?: add.rum
|
||||
(~(put by peers.str.sta) [our.bol cir.rum] ~)
|
||||
(~(del by peers.str.sta) [our.bol cir.rum])
|
||||
==
|
||||
:- (send-chat-update [[%circles cis] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
::
|
||||
:: %circle: fill remote configs with message data
|
||||
@ -303,10 +316,11 @@
|
||||
=* messages messages.str.sta
|
||||
=/ circle/circle:hall [`@p`(slav %p &2:wir) &3:wir]
|
||||
=/ nes/(list envelope:hall) (~(got by messages) circle)
|
||||
:- (send-chat-update [%message circle nev.sto])
|
||||
%= this
|
||||
messages.str.sta (~(put by messages) circle (snoc nes nev.sto))
|
||||
=/ str %= str.sta
|
||||
messages (~(put by messages) circle (snoc nes nev.sto))
|
||||
==
|
||||
:- (send-chat-update [[%message circle nev.sto] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
:: %status:
|
||||
::
|
||||
@ -319,11 +333,12 @@
|
||||
?: =(%remove -.dif.sto)
|
||||
(~(del in u.upeers) who.sto)
|
||||
(~(put in u.upeers) who.sto)
|
||||
:- (send-chat-update [%peers cir.sto peers])
|
||||
%= this
|
||||
peers.str.sta (~(put by peers.str.sta) cir.sto peers)
|
||||
==
|
||||
|
||||
=/ str
|
||||
%= str.sta
|
||||
peers (~(put by peers.str.sta) cir.sto peers)
|
||||
==
|
||||
:- (send-chat-update [[%peers cir.sto peers] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
:: %config: config has changed
|
||||
::
|
||||
@ -337,10 +352,12 @@
|
||||
::
|
||||
%full
|
||||
=* conf cof.dif.sto
|
||||
:- (send-chat-update [%config circ conf])
|
||||
%= this
|
||||
configs.str.sta (~(put by configs.str.sta) circ `conf)
|
||||
==
|
||||
=/ str
|
||||
%= str.sta
|
||||
configs (~(put by configs.str.sta) circ `conf)
|
||||
==
|
||||
:- (send-chat-update [[%config circ conf] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
:: %read: the read count of one of our configs has changed
|
||||
::
|
||||
@ -356,10 +373,12 @@
|
||||
%= u.uconf
|
||||
red red.dif.sto
|
||||
==
|
||||
:- (send-chat-update [%config circ conf])
|
||||
%= this
|
||||
configs.str.sta (~(put by configs.str.sta) circ `conf)
|
||||
==
|
||||
=/ str
|
||||
%= str.sta
|
||||
configs (~(put by configs.str.sta) circ `conf)
|
||||
==
|
||||
:- (send-chat-update [[%config circ conf] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
:: %source: the sources of our inbox have changed
|
||||
::
|
||||
@ -377,33 +396,37 @@
|
||||
=/ newinbox %= inbox.str.sta
|
||||
src (~(put in src.inbox.str.sta) src.dif.sto)
|
||||
==
|
||||
:-
|
||||
=/ str
|
||||
%= str.sta
|
||||
inbox newinbox
|
||||
::
|
||||
configs
|
||||
?: (~(has by configs.str.sta) affectedcir)
|
||||
configs.str.sta
|
||||
(~(put by configs.str.sta) affectedcir ~)
|
||||
==
|
||||
::
|
||||
:_ this(str.sta str)
|
||||
%+ weld
|
||||
[ost.bol %peer newwir [hos.affectedcir %hall] pat]~
|
||||
(send-chat-update [%inbox newinbox])
|
||||
%= this
|
||||
inbox.str.sta newinbox
|
||||
::src.inbox.str.sta (~(put in src.inbox.str.sta) src.dif.sto)
|
||||
::
|
||||
configs.str.sta
|
||||
?: (~(has by configs.str.sta) affectedcir)
|
||||
configs.str.sta
|
||||
(~(put by configs.str.sta) affectedcir ~)
|
||||
==
|
||||
(send-chat-update [[%inbox newinbox] str])
|
||||
::
|
||||
=/ newinbox %= inbox.str.sta
|
||||
src (~(del in src.inbox.str.sta) src.dif.sto)
|
||||
==
|
||||
:: we've removed a source from our inbox
|
||||
::
|
||||
:-
|
||||
=/ str
|
||||
%= str.sta
|
||||
inbox newinbox
|
||||
::
|
||||
configs (~(del by configs.str.sta) affectedcir)
|
||||
==
|
||||
::
|
||||
:_ this(str.sta str)
|
||||
%+ weld
|
||||
[ost.bol %pull newwir [hos.affectedcir %hall] ~]~
|
||||
(send-chat-update [%inbox newinbox])
|
||||
%= this
|
||||
src.inbox.str.sta (~(del in src.inbox.str.sta) src.dif.sto)
|
||||
::
|
||||
configs.str.sta (~(del by configs.str.sta) affectedcir)
|
||||
==
|
||||
(send-chat-update [[%inbox newinbox] str])
|
||||
==
|
||||
:: end of branching on dif.sto type
|
||||
==
|
||||
|
@ -17,6 +17,10 @@
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
function getCjsExportFromNamespace (n) {
|
||||
return n && n.default || n;
|
||||
}
|
||||
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@ -47892,6 +47896,8 @@
|
||||
isBuffer: isBuffer
|
||||
});
|
||||
|
||||
var require$$0 = getCjsExportFromNamespace(bufferEs6);
|
||||
|
||||
var bn = createCommonjsModule(function (module) {
|
||||
(function (module, exports) {
|
||||
|
||||
@ -47944,7 +47950,7 @@
|
||||
|
||||
var Buffer;
|
||||
try {
|
||||
Buffer = bufferEs6.Buffer;
|
||||
Buffer = require$$0.Buffer;
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@ -56646,26 +56652,41 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
updateInvite(uid, cir, resp) {
|
||||
let tagstring = resp ? "Accept" : "Reject";
|
||||
|
||||
let msg = {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
}
|
||||
console.log(this.props.config);
|
||||
|
||||
this.props.api.chat({
|
||||
actions: {
|
||||
lis: [{
|
||||
source: {
|
||||
nom: "inbox",
|
||||
sub: resp,
|
||||
srs: [cir]
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
this.props.api.hall({
|
||||
phrase: msg
|
||||
},
|
||||
{
|
||||
phrase: {
|
||||
aud: [`~${window.ship}/i`],
|
||||
ses: [{
|
||||
ire: {
|
||||
top: uid,
|
||||
sep: {
|
||||
lin: {
|
||||
msg: `${tagstring} ${cir}`,
|
||||
pat: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
read: {
|
||||
nom: 'i',
|
||||
red: this.props.config.red + 2
|
||||
}
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
||||
this.props.api.source(cir, resp);
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -56674,33 +56695,33 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
let cir = lodash.get(props, 'msg.sep.inv.cir', false);
|
||||
let aut = lodash.get(props, 'msg.aut', false);
|
||||
|
||||
if (!aut || !cir) {
|
||||
if (!aut || !cir || !props.config) {
|
||||
return (
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$4, lineNumber: 62}})
|
||||
react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$4, lineNumber: 77}})
|
||||
);
|
||||
}
|
||||
|
||||
cir = cir.split('/')[1];
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "pa3", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 69}}
|
||||
, react.createElement('div', { className: "w-100 v-mid" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 70}}
|
||||
react.createElement('div', { className: "pa3", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 84}}
|
||||
, react.createElement('div', { className: "w-100 v-mid" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 85}}
|
||||
, react.createElement('div', { className: "dib mr2 bg-nice-green" , style: {
|
||||
borderRadius: 12,
|
||||
width: 12,
|
||||
height: 12
|
||||
}, __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 71}})
|
||||
, react.createElement('p', { className: "dib body-regular fw-normal" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 76}}, "Invite to "
|
||||
, react.createElement('span', { className: "fw-bold", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 77}}
|
||||
}, __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 86}})
|
||||
, react.createElement('p', { className: "dib body-regular fw-normal" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 91}}, "Invite to "
|
||||
, react.createElement('span', { className: "fw-bold", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 92}}
|
||||
, cir
|
||||
)
|
||||
)
|
||||
)
|
||||
, react.createElement('div', { className: "w-100", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 82}}
|
||||
, react.createElement('p', { className: "dib gray label-small-mono" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 83}}, "Hosted by " , aut)
|
||||
, react.createElement('div', { className: "w-100", __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 97}}
|
||||
, react.createElement('p', { className: "dib gray label-small-mono" , __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 98}}, "Hosted by " , aut)
|
||||
)
|
||||
, react.createElement('a', { className: "dib w-50 pointer btn-font nice-green underline" , onClick: this.onAccept.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 85}}, "Accept")
|
||||
, react.createElement('a', { className: "dib w-50 tr pointer btn-font nice-red underline" , onClick: this.onReject.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 86}}, "Reject")
|
||||
, react.createElement('a', { className: "dib w-50 pointer btn-font nice-green underline" , onClick: this.onAccept.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 100}}, "Accept")
|
||||
, react.createElement('a', { className: "dib w-50 tr pointer btn-font nice-red underline" , onClick: this.onReject.bind(this), __self: this, __source: {fileName: _jsxFileName$4, lineNumber: 101}}, "Reject")
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -56717,7 +56738,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
render() {
|
||||
const { props } = this;
|
||||
let station = props.match.params.ship + '/' + props.match.params.station;
|
||||
|
||||
|
||||
let sidebarItems = props.circles.map((cir) => {
|
||||
let msg = props.messagePreviews[cir];
|
||||
let parsed = !!msg ? getMessageContent(msg.gam) : {
|
||||
@ -56775,20 +56796,24 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
return !(msg.uid in filterInvites);
|
||||
}).map((inv) => {
|
||||
return (
|
||||
react.createElement(SidebarInvite, { key: inv.uid, msg: inv, api: props.api, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 78}} )
|
||||
react.createElement(SidebarInvite, {
|
||||
key: inv.uid,
|
||||
msg: inv,
|
||||
api: props.api,
|
||||
config: props.inviteConfig, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 78}}
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 84}}
|
||||
, react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 85}}
|
||||
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 86}}, "Chat")
|
||||
react.createElement('div', { className: "h-100 w-100 overflow-x-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 88}}
|
||||
, react.createElement('div', { className: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 89}}
|
||||
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 90}}, "Chat")
|
||||
, react.createElement('a', {
|
||||
className: "dib tr w-50 pointer plus-font" ,
|
||||
onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 87}}, "+")
|
||||
onClick: this.onClickNew.bind(this), __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 91}}, "+")
|
||||
)
|
||||
, react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 91}}
|
||||
, react.createElement('div', { style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 95}}
|
||||
, inviteItems
|
||||
, sidebarItems
|
||||
)
|
||||
@ -57738,6 +57763,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
const { props, state } = this;
|
||||
|
||||
let configs = !!state.configs ? state.configs : {};
|
||||
|
||||
let circles = Object.keys(configs).filter((conf) => {
|
||||
if (!configs[conf]) {
|
||||
return false;
|
||||
@ -57751,7 +57777,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
Object.keys(messages).forEach((stat) => {
|
||||
let arr = messages[stat];
|
||||
if (arr.length === 0) {
|
||||
messagePreviews[stat] = null;
|
||||
messagePreviews[stat] = false;
|
||||
} else {
|
||||
messagePreviews[stat] = arr[arr.length - 1];
|
||||
}
|
||||
@ -57759,7 +57785,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
let unreads = {};
|
||||
circles.forEach((cir) => {
|
||||
if (cir in messagePreviews) {
|
||||
if (cir in messagePreviews && !!messagePreviews[cir]) {
|
||||
unreads[cir] = state.configs[cir].red < messagePreviews[cir].num;
|
||||
} else {
|
||||
unreads[cir] = false;
|
||||
@ -57773,9 +57799,14 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
invites = [];
|
||||
}
|
||||
|
||||
let inviteConfig = false;
|
||||
if (`~${window.ship}/i` in configs) {
|
||||
inviteConfig = configs[`~${window.ship}/i`];
|
||||
}
|
||||
|
||||
return (
|
||||
react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 76}}
|
||||
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 77}}
|
||||
react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 82}}
|
||||
, react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$h, lineNumber: 83}}
|
||||
, react.createElement(Route, { exact: true, path: "/~chat",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57787,19 +57818,20 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
invites: invites,
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 83}}
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 89}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 81}}
|
||||
, react.createElement('div', { className: "w-100 h-100 fr" , style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 92}}
|
||||
, react.createElement('div', { className: "dt w-100 h-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 93}}
|
||||
, react.createElement('div', { className: "dtc center v-mid w-100 h-100 bg-white" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 94}}
|
||||
, react.createElement('p', { className: "tc", __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 95}}, "Cmd + N to start a new chat" )
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 87}}
|
||||
, react.createElement('div', { className: "w-100 h-100 fr" , style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 99}}
|
||||
, react.createElement('div', { className: "dt w-100 h-100" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 100}}
|
||||
, react.createElement('div', { className: "dtc center v-mid w-100 h-100 bg-white" , __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 101}}
|
||||
, react.createElement('p', { className: "tc", __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 102}}, "Cmd + N to start a new chat" )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 78}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 84}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/new",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57811,16 +57843,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
invites: invites,
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 107}}
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 114}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 105}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 112}}
|
||||
, react.createElement(NewScreen, {
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 116}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 124}}
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 102}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 109}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station",
|
||||
render: (props) => {
|
||||
let station =
|
||||
@ -57837,20 +57870,21 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
invites: invites,
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 133}}
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 141}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 131}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 139}}
|
||||
, react.createElement(ChatScreen, {
|
||||
api: api,
|
||||
configs: configs,
|
||||
messages: messages,
|
||||
peers: state.peers,
|
||||
subscription: subscription,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 142}}
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 151}}
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 123}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 131}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/members",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57862,17 +57896,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
invites: invites,
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 158}}
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 167}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 156}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 165}}
|
||||
, react.createElement(MemberScreen, {
|
||||
...props,
|
||||
api: api,
|
||||
peers: state.peers, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 167}}
|
||||
peers: state.peers, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 177}}
|
||||
)
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 153}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 162}} )
|
||||
, react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/settings",
|
||||
render: (props) => {
|
||||
return (
|
||||
@ -57884,17 +57919,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
invites: invites,
|
||||
unreads: unreads,
|
||||
api: api,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 180}}
|
||||
inviteConfig: inviteConfig,
|
||||
...props, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 190}}
|
||||
)
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 178}}
|
||||
, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 188}}
|
||||
, react.createElement(SettingsScreen, {
|
||||
...props,
|
||||
api: api,
|
||||
peers: state.peers,
|
||||
store: store, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 189}} )
|
||||
store: store, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 200}} )
|
||||
)
|
||||
);
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 175}} )
|
||||
}, __self: this, __source: {fileName: _jsxFileName$h, lineNumber: 185}} )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user