mirror of
https://github.com/urbit/shrub.git
synced 2024-12-13 16:03:36 +03:00
Merge branch 'master' of https://github.com/urbit/interface
This commit is contained in:
commit
c7b7f7eaf6
@ -36,6 +36,7 @@ export class ChatScreen extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.updateNumPeople();
|
||||
this.updateReadNumber();
|
||||
}
|
||||
|
||||
componentWillUnMount() {
|
||||
|
@ -18,6 +18,17 @@ export class NewScreen extends Component {
|
||||
this.invChange = this.invChange.bind(this);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { props, state } = this;
|
||||
|
||||
if (prevProps.circles !== props.circles) {
|
||||
let station = `~${window.ship}/${state.idName}`;
|
||||
if (props.circles.includes(station)) {
|
||||
props.history.push('/~chat/' + station);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
idChange(event) {
|
||||
this.setState({
|
||||
idName: event.target.value,
|
||||
@ -33,7 +44,7 @@ export class NewScreen extends Component {
|
||||
const { props, state } = this;
|
||||
if (!state.idName || !!state.showNameError) { return; }
|
||||
|
||||
let station = `~${props.api.authTokens.ship}/${state.idName}`;
|
||||
let station = `~${window.ship}/${state.idName}`;
|
||||
let actions = [
|
||||
{
|
||||
create: {
|
||||
@ -79,7 +90,6 @@ export class NewScreen extends Component {
|
||||
}
|
||||
|
||||
props.api.chat(actions);
|
||||
props.history.push('/~chat/' + station);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -139,6 +139,7 @@ export class Root extends Component {
|
||||
}>
|
||||
<NewScreen
|
||||
api={api}
|
||||
circles={circles}
|
||||
{...props}
|
||||
/>
|
||||
</Skeleton>
|
||||
|
@ -13,12 +13,47 @@ export class Sidebar extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
invites: []
|
||||
};
|
||||
|
||||
this.setInvitesToReadInterval = setInterval(
|
||||
this.setInvitesToRead.bind(this),
|
||||
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 = _.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() {
|
||||
if (this.setInvitesToReadInterval) {
|
||||
clearInterval(this.setInvitesToReadInterval);
|
||||
@ -27,14 +62,21 @@ export class Sidebar extends Component {
|
||||
}
|
||||
|
||||
setInvitesToRead() {
|
||||
const { props } = this;
|
||||
const { props, state } = this;
|
||||
|
||||
if (
|
||||
props.inviteConfig &&
|
||||
'red' in props.inviteConfig &&
|
||||
props.invites.length > 0 &&
|
||||
props.inviteConfig.red < (props.invites[props.invites.length - 1].num + 1)
|
||||
props.invites.length > 0
|
||||
) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +85,7 @@ export class Sidebar extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { props } = this;
|
||||
const { props, state } = this;
|
||||
let station = props.match.params.ship + '/' + props.match.params.station;
|
||||
|
||||
let sidebarItems = props.circles
|
||||
@ -93,21 +135,7 @@ export class Sidebar extends Component {
|
||||
);
|
||||
});
|
||||
|
||||
let invites = [];
|
||||
|
||||
let filterInvites = {};
|
||||
props.invites.forEach((msg) => {
|
||||
let uid = _.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) => {
|
||||
let inviteItems = state.invites.map((inv) => {
|
||||
return (
|
||||
<SidebarInvite
|
||||
key={inv.uid}
|
||||
|
@ -30,8 +30,6 @@ class Store {
|
||||
handleEvent(data) {
|
||||
let json = data.data;
|
||||
|
||||
console.log(json);
|
||||
|
||||
this.initialReducer.reduce(json, this.state);
|
||||
this.configReducer.reduce(json, this.state);
|
||||
this.updateReducer.reduce(json, this.state);
|
||||
|
@ -32,7 +32,6 @@ export default class ChatTile extends Component {
|
||||
|
||||
render() {
|
||||
const { state } = this;
|
||||
|
||||
let inviteNum = 0;
|
||||
let msgNum = 0;
|
||||
let inviteCircle = `~${window.ship}/i`;
|
||||
@ -51,19 +50,16 @@ export default class ChatTile extends Component {
|
||||
let host = key.split('/')[0];
|
||||
|
||||
if (!state.configs[key]) { break; }
|
||||
if (!(key in numbers)) { break; }
|
||||
|
||||
let red = state.configs[key].red;
|
||||
console.log(key, red, numbers[key]);
|
||||
|
||||
if (key === inviteCircle) {
|
||||
inviteNum = inviteNum - red + numbers[key];
|
||||
console.log('case 1', inviteNum);
|
||||
} else if (host === `~${window.ship}`) {
|
||||
msgNum = msgNum - red + numbers[key];
|
||||
console.log('case 2', msgNum);
|
||||
} else {
|
||||
msgNum = msgNum + numbers[key];
|
||||
console.log('case 3', msgNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,11 +81,11 @@
|
||||
[cir 0]
|
||||
=/ last (snag (dec (lent lis)) `(list envelope:hall)`lis)
|
||||
[cir (add num.last 1)]
|
||||
=/ maptjson *(map @t json)
|
||||
=. maptjson
|
||||
(~(put by maptjson) 'config' (config-to-json str))
|
||||
=. maptjson
|
||||
(~(put by maptjson) 'numbers' (numbers-to-json numbers))
|
||||
=/ maptjson=(map @t json)
|
||||
%- my
|
||||
:~ ['config' (config-to-json str)]
|
||||
['numbers' (numbers-to-json numbers)]
|
||||
==
|
||||
[%o maptjson]
|
||||
::
|
||||
++ peer-chattile
|
||||
@ -102,8 +102,8 @@
|
||||
^- (quip move _this)
|
||||
~& (lent (prey:pubsub:userlib /primary bol))
|
||||
=* messages messages.str.sta
|
||||
=/ lisunitmov=(list (unit move))
|
||||
%+ turn ~(tap by messages)
|
||||
=/ lismov/(list move)
|
||||
%+ murn ~(tap by messages)
|
||||
|= [cir=circle:hall lis=(list envelope:hall)]
|
||||
^- (unit move)
|
||||
=/ envs/(unit (list envelope:hall)) (~(get by messages) cir)
|
||||
@ -123,15 +123,7 @@
|
||||
[%messages cir start end (swag [start offset] u.envs)]
|
||||
==
|
||||
:_ this
|
||||
%+ weld
|
||||
[ost.bol %diff %chat-config str.sta]~
|
||||
%+ turn %+ skim lisunitmov
|
||||
|= umov=(unit move)
|
||||
^- ?
|
||||
?~ umov
|
||||
%.n
|
||||
%.y
|
||||
need
|
||||
[[ost.bol %diff %chat-config str.sta] lismov]
|
||||
::
|
||||
:: +poke-chat: send us an action
|
||||
::
|
||||
@ -304,13 +296,14 @@
|
||||
?: add.rum
|
||||
(~(put in circles.str.sta) cir.rum)
|
||||
(~(del in circles.str.sta) cir.rum)
|
||||
=/ str %= str.sta
|
||||
=/ 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)
|
||||
::
|
||||
@ -329,10 +322,14 @@
|
||||
?> ?=(%gram -.sto)
|
||||
=* messages messages.str.sta
|
||||
=/ circle/circle:hall [`@p`(slav %p &2:wir) &3:wir]
|
||||
=/ nes/(list envelope:hall) (~(got by messages) circle)
|
||||
=/ str %= str.sta
|
||||
messages (~(put by messages) circle (snoc nes nev.sto))
|
||||
==
|
||||
=/ unes/(unit (list envelope:hall)) (~(get by messages) circle)
|
||||
?~ unes
|
||||
[~ this]
|
||||
=/ nes u.unes
|
||||
=/ str
|
||||
%= str.sta
|
||||
messages (~(put by messages) circle (snoc nes nev.sto))
|
||||
==
|
||||
:- (send-chat-update [[%message circle nev.sto] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
@ -574,15 +571,15 @@
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circle
|
||||
=/ shp/@p (slav %p &2:wir)
|
||||
=/ pat /circle/[&3:wir]/config/group
|
||||
?: =(&3:wir 'inbox')
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
?: (~(has in src.inbox.str.sta) [[shp &3:wir] ~])
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
[~ this]
|
||||
=/ shp/@p (slav %p &2:wir)
|
||||
=/ pat /circle/[&3:wir]/config/group
|
||||
?: =(&3:wir 'inbox')
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
?: (~(has in src.inbox.str.sta) [[shp &3:wir] ~])
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
[~ this]
|
||||
::
|
||||
%circles
|
||||
:_ this
|
||||
@ -600,15 +597,15 @@
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circle
|
||||
=/ shp/@p (slav %p &2:wir)
|
||||
=/ pat /circle/[&3:wir]/config/group
|
||||
?: =(&3:wir 'inbox')
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
?: (~(has in src.inbox.str.sta) [[shp &3:wir] ~])
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
[~ this]
|
||||
=/ shp/@p (slav %p &2:wir)
|
||||
=/ pat /circle/[&3:wir]/config/group
|
||||
?: =(&3:wir 'inbox')
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
?: (~(has in src.inbox.str.sta) [[shp &3:wir] ~])
|
||||
:_ this
|
||||
[ost.bol %peer wir [shp %hall] pat]~
|
||||
[~ this]
|
||||
::
|
||||
%circles
|
||||
:_ this
|
||||
|
@ -17,10 +17,6 @@
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
function getCjsExportFromNamespace (n) {
|
||||
return n && n.default || n;
|
||||
}
|
||||
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@ -45901,8 +45897,6 @@
|
||||
handleEvent(data) {
|
||||
let json = data.data;
|
||||
|
||||
console.log(json);
|
||||
|
||||
this.initialReducer.reduce(json, this.state);
|
||||
this.configReducer.reduce(json, this.state);
|
||||
this.updateReducer.reduce(json, this.state);
|
||||
@ -47902,8 +47896,6 @@
|
||||
isBuffer: isBuffer
|
||||
});
|
||||
|
||||
var require$$0 = getCjsExportFromNamespace(bufferEs6);
|
||||
|
||||
var bn = createCommonjsModule(function (module) {
|
||||
(function (module, exports) {
|
||||
|
||||
@ -47956,7 +47948,7 @@
|
||||
|
||||
var Buffer;
|
||||
try {
|
||||
Buffer = require$$0.Buffer;
|
||||
Buffer = bufferEs6.Buffer;
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@ -56741,12 +56733,47 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
invites: []
|
||||
};
|
||||
|
||||
this.setInvitesToReadInterval = setInterval(
|
||||
this.setInvitesToRead.bind(this),
|
||||
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() {
|
||||
if (this.setInvitesToReadInterval) {
|
||||
clearInterval(this.setInvitesToReadInterval);
|
||||
@ -56755,14 +56782,21 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
}
|
||||
|
||||
setInvitesToRead() {
|
||||
const { props } = this;
|
||||
const { props, state } = this;
|
||||
|
||||
if (
|
||||
props.inviteConfig &&
|
||||
'red' in props.inviteConfig &&
|
||||
props.invites.length > 0 &&
|
||||
props.inviteConfig.red < (props.invites[props.invites.length - 1].num + 1)
|
||||
props.invites.length > 0
|
||||
) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -56771,7 +56805,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
}
|
||||
|
||||
render() {
|
||||
const { props } = this;
|
||||
const { props, state } = this;
|
||||
let station = props.match.params.ship + '/' + props.match.params.station;
|
||||
|
||||
let sidebarItems = props.circles
|
||||
@ -56816,45 +56850,31 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
ship: obj.aut,
|
||||
selected: obj.selected,
|
||||
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 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) => {
|
||||
let inviteItems = state.invites.map((inv) => {
|
||||
return (
|
||||
react.createElement(SidebarInvite, {
|
||||
key: inv.uid,
|
||||
msg: inv,
|
||||
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 (
|
||||
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: "pl3 pr3 pt3 pb3 cf" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 123}}
|
||||
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 124}}, "Chat")
|
||||
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: 151}}
|
||||
, react.createElement('p', { className: "dib w-50 fw-bold body-large" , __self: this, __source: {fileName: _jsxFileName$5, lineNumber: 152}}, "Chat")
|
||||
, react.createElement('a', {
|
||||
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
|
||||
, sidebarItems
|
||||
)
|
||||
@ -57272,6 +57292,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
componentDidMount() {
|
||||
this.updateNumPeople();
|
||||
this.updateReadNumber();
|
||||
}
|
||||
|
||||
componentWillUnMount() {
|
||||
@ -57393,7 +57414,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
return (
|
||||
react.createElement('a', {
|
||||
className: "vanilla hoverline text-600 text-mono" ,
|
||||
href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 158}}
|
||||
href: prettyShip(msg.gam.aut)[1], __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 159}}
|
||||
, prettyShip(`~${msg.gam.aut}`)[0]
|
||||
)
|
||||
);
|
||||
@ -57403,7 +57424,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
react.createElement(Message, {
|
||||
key: msg.gam.uid + Math.random(),
|
||||
msg: msg.gam,
|
||||
details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 167}} )
|
||||
details: details, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 168}} )
|
||||
);
|
||||
}
|
||||
|
||||
@ -57425,18 +57446,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
|
||||
return (
|
||||
react.createElement('div', { key: state.station,
|
||||
className: "h-100 w-100 overflow-hidden flex flex-column" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 191}}
|
||||
, react.createElement('div', { className: "pl2 pt2 bb" , __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 193}}
|
||||
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 194}}, state.circle)
|
||||
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: 194}}
|
||||
, react.createElement('h2', {__self: this, __source: {fileName: _jsxFileName$c, lineNumber: 195}}, state.circle)
|
||||
, react.createElement(ChatTabBar, { ...props,
|
||||
station: state.station,
|
||||
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 195}} )
|
||||
numPeers: peers.length, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 196}} )
|
||||
)
|
||||
, react.createElement('div', {
|
||||
className: "overflow-y-scroll pt3 flex flex-column-reverse" ,
|
||||
style: { height: 'calc(100% - 157px)' },
|
||||
onScroll: this.onScroll, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 199}}
|
||||
, react.createElement('div', { ref: el => { this.scrollElement = el; }, __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 203}})
|
||||
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: 204}})
|
||||
, chatMessages
|
||||
)
|
||||
, react.createElement(ChatInput, {
|
||||
@ -57444,7 +57465,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\
|
||||
numMsgs: lastMsgNum,
|
||||
station: state.station,
|
||||
circle: state.circle,
|
||||
placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 206}} )
|
||||
placeholder: "Message...", __self: this, __source: {fileName: _jsxFileName$c, lineNumber: 207}} )
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -19323,7 +19323,6 @@
|
||||
|
||||
render() {
|
||||
const { state } = this;
|
||||
|
||||
let inviteNum = 0;
|
||||
let msgNum = 0;
|
||||
let inviteCircle = `~${window.ship}/i`;
|
||||
@ -19342,37 +19341,34 @@
|
||||
let host = key.split('/')[0];
|
||||
|
||||
if (!state.configs[key]) { break; }
|
||||
if (!(key in numbers)) { break; }
|
||||
|
||||
let red = state.configs[key].red;
|
||||
console.log(key, red, numbers[key]);
|
||||
|
||||
if (key === inviteCircle) {
|
||||
inviteNum = inviteNum - red + numbers[key];
|
||||
console.log('case 1', inviteNum);
|
||||
} else if (host === `~${window.ship}`) {
|
||||
msgNum = msgNum - red + numbers[key];
|
||||
console.log('case 2', msgNum);
|
||||
} else {
|
||||
msgNum = msgNum + numbers[key];
|
||||
console.log('case 3', msgNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
react.createElement('div', { className: "w-100 h-100 relative" , style: { background: '#1a1a1a' }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 72}}
|
||||
, react.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~chat", __self: this, __source: {fileName: _jsxFileName, lineNumber: 73}}
|
||||
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: 69}}
|
||||
, react.createElement('p', { className: "gray", style: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: 14,
|
||||
lineHeight: '24px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 74}}, "Chat")
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 70}}, "Chat")
|
||||
, react.createElement('img', {
|
||||
className: "absolute",
|
||||
style: { left: 68, top: 65 },
|
||||
src: "/~chat/img/Tile.png",
|
||||
width: 106,
|
||||
height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 79}} )
|
||||
height: 98, __self: this, __source: {fileName: _jsxFileName, lineNumber: 75}} )
|
||||
, react.createElement('p', {
|
||||
className: "absolute white" ,
|
||||
style: {
|
||||
@ -19380,7 +19376,7 @@
|
||||
fontWeight: 600,
|
||||
fontSize: 16,
|
||||
lineHeight: '20px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 85}}, inviteNum, " invites" )
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 81}}, inviteNum, " invites" )
|
||||
, react.createElement('p', {
|
||||
className: "absolute white" ,
|
||||
style: {
|
||||
@ -19388,7 +19384,7 @@
|
||||
fontWeight: 600,
|
||||
fontSize: 16,
|
||||
lineHeight: '20px'
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 93}}, msgNum, " new messages" )
|
||||
}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 89}}, msgNum, " new messages" )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -39,11 +39,12 @@
|
||||
++ prep
|
||||
|= old=(unit ~)
|
||||
^- (quip move _this)
|
||||
=/ lismov/(list move) %+ weld
|
||||
`(list move)`[ost.bol %connect / [~ /'~clock'] %clock]~
|
||||
`(list move)`[ost.bol %poke /clock [our.bol %launch] [%noun [%clock /tile '/~clock/js/tile.js']]]~
|
||||
:- lismov
|
||||
this
|
||||
=/ launchnoun [%noun [%clock /tile '/~clock/js/tile.js']]
|
||||
:_ this
|
||||
:~
|
||||
[ost.bol %connect / [~ /'~clock'] %clock]
|
||||
[ost.bol %poke /clock [our.bol %launch] launchnoun]
|
||||
==
|
||||
::
|
||||
++ peer-tile
|
||||
|= pax=path
|
||||
@ -61,10 +62,10 @@
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
^- (quip move _this)
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ back-path (flop site.request-line)
|
||||
=/ name=@t
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ back-path (flop site.request-line)
|
||||
?~ back-path
|
||||
''
|
||||
i.back-path
|
||||
|
@ -79,10 +79,12 @@
|
||||
=/ data/(unit [json url=@t]) (~(get by data.sta) name)
|
||||
?~ data
|
||||
[~ this]
|
||||
::
|
||||
:-
|
||||
%+ turn (prey:pubsub:userlib /main bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %json (frond:enjs:format name jon)]
|
||||
|= [=bone *]
|
||||
[bone %diff %json (frond:enjs:format name jon)]
|
||||
::
|
||||
%= this
|
||||
data.sta (~(put by data.sta) name [jon url.u.data])
|
||||
==
|
||||
@ -102,9 +104,9 @@
|
||||
|= data=tile-data
|
||||
^- marl
|
||||
%+ turn ~(tap by data)
|
||||
|= [key=@tas [jon=json url=@t]]
|
||||
^- manx
|
||||
;script@"{(trip url)}";
|
||||
|= [key=@tas [jon=json url=@t]]
|
||||
^- manx
|
||||
;script@"{(trip url)}";
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|
@ -44,10 +44,12 @@
|
||||
++ prep
|
||||
|= old=(unit tim=@da)
|
||||
^- (quip move _this)
|
||||
=/ lismov/(list move) %+ weld
|
||||
`(list move)`[ost.bol %connect / [~ /'~timer'] %timer]~
|
||||
`(list move)`[ost.bol %poke /timer [our.bol %launch] [%noun [%timer /tile '/~timer/js/tile.js']]]~
|
||||
:- lismov
|
||||
=/ launchnoun [%noun [%timer /tile '/~timer/js/tile.js']]
|
||||
:-
|
||||
:~
|
||||
[ost.bol %connect / [~ /'~timer'] %timer]
|
||||
[ost.bol %poke /timer [our.bol %launch] launchnoun]
|
||||
==
|
||||
?~ old
|
||||
this
|
||||
%= this
|
||||
@ -76,25 +78,21 @@
|
||||
=/ str/@t +.jon
|
||||
?: =(str 'start')
|
||||
=/ data/@da (add now.bol ~s10)
|
||||
:- %+ weld
|
||||
`(list move)`(send-tile-diff [%s (scot %da data)])
|
||||
`(list move)`[ost.bol %wait /timer data]~
|
||||
this(tim data)
|
||||
:_ this(tim data)
|
||||
[[ost.bol %wait /timer data] (send-tile-diff [%s (scot %da data)])]
|
||||
?: =(str 'stop')
|
||||
:- %+ weld
|
||||
`(list move)`(send-tile-diff [%s ''])
|
||||
`(list move)`[ost.bol %rest /timer tim]~
|
||||
this(tim *@da)
|
||||
:_ this(tim *@da)
|
||||
[[ost.bol %rest /timer tim] (send-tile-diff [%s ''])]
|
||||
[~ this]
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:http-server
|
||||
^- (quip move _this)
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ back-path (flop site.request-line)
|
||||
=/ name=@t
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ back-path (flop site.request-line)
|
||||
?~ back-path
|
||||
''
|
||||
i.back-path
|
||||
|
Loading…
Reference in New Issue
Block a user