This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-intl": "^6.3.0",
|
"react-intl": "^6.3.0",
|
||||||
"tinode-sdk": "^0.22.7",
|
"tinode-sdk": "^0.22.8",
|
||||||
"webm-duration-fix": "^1.0.4"
|
"webm-duration-fix": "^1.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -209,18 +209,6 @@ class MessagesView extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
const p = [];
|
|
||||||
const s = [];
|
|
||||||
Object.entries(this.props).forEach(([key, val]) =>
|
|
||||||
prevProps[key] !== val && p.push(key)
|
|
||||||
);
|
|
||||||
if (this.state) {
|
|
||||||
Object.entries(this.state).forEach(([key, val]) =>
|
|
||||||
prevState[key] !== val && s.push(key)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
console.log(`Prop '${p}', state '${s}' changed`);
|
|
||||||
|
|
||||||
// Scroll last message into view on component update e.g. on message received
|
// Scroll last message into view on component update e.g. on message received
|
||||||
// or vertical shrinking.
|
// or vertical shrinking.
|
||||||
if (this.messagesScroller &&
|
if (this.messagesScroller &&
|
||||||
|
|||||||
@@ -848,7 +848,7 @@ class TinodeWeb extends React.Component {
|
|||||||
}
|
}
|
||||||
} else if (what == 'read') {
|
} else if (what == 'read') {
|
||||||
this.resetContactList();
|
this.resetContactList();
|
||||||
} else if (what == 'msg') {
|
} else if (what == 'msg' && cont) {
|
||||||
// Check if the topic is archived. If so, don't play a sound.
|
// Check if the topic is archived. If so, don't play a sound.
|
||||||
const topic = this.tinode.getTopic(cont.topic);
|
const topic = this.tinode.getTopic(cont.topic);
|
||||||
const archived = topic && topic.isArchived();
|
const archived = topic && topic.isArchived();
|
||||||
@@ -870,7 +870,6 @@ class TinodeWeb extends React.Component {
|
|||||||
// Topic deleted or user unsubscribed. Remove topic from view.
|
// Topic deleted or user unsubscribed. Remove topic from view.
|
||||||
// If the currently selected topic is gone, clear the selection.
|
// If the currently selected topic is gone, clear the selection.
|
||||||
if (this.state.topicSelected == cont.topic) {
|
if (this.state.topicSelected == cont.topic) {
|
||||||
console.log("tnMeContactUpdate", cont.topic, what);
|
|
||||||
this.handleTopicSelected(null);
|
this.handleTopicSelected(null);
|
||||||
}
|
}
|
||||||
// Redraw without the deleted topic.
|
// Redraw without the deleted topic.
|
||||||
@@ -888,7 +887,7 @@ class TinodeWeb extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
// TODO(gene): handle other types of notifications:
|
// TODO(gene): handle other types of notifications:
|
||||||
// * ua -- user agent changes (maybe display a pictogram for mobile/desktop).
|
// * ua -- user agent changes (maybe display a pictogram for mobile/desktop).
|
||||||
console.info("Unsupported (yet) presence update:", what, "in", cont.topic);
|
console.info("Unsupported (yet) presence update:", what, "in", (cont || {}).topic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1020,6 +1019,7 @@ class TinodeWeb extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
// Currently selected contact deleted
|
// Currently selected contact deleted
|
||||||
this.setState({
|
this.setState({
|
||||||
|
topicSelected: null,
|
||||||
errorText: '',
|
errorText: '',
|
||||||
errorLevel: null,
|
errorLevel: null,
|
||||||
mobilePanel: 'sidepanel',
|
mobilePanel: 'sidepanel',
|
||||||
|
|||||||
+3
-13
@@ -5263,16 +5263,6 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
Object.entries(this.props).forEach(_ref => {
|
|
||||||
let [key, val] = _ref;
|
|
||||||
return prevProps[key] !== val && console.log(`Prop '${key}' changed`);
|
|
||||||
});
|
|
||||||
if (this.state) {
|
|
||||||
Object.entries(this.state).forEach(_ref2 => {
|
|
||||||
let [key, val] = _ref2;
|
|
||||||
return prevState[key] !== val && console.log(`State '${key}' changed`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (this.messagesScroller && (prevState.topic != this.state.topic || prevState.maxSeqId != this.state.maxSeqId || prevState.minSeqId != this.state.minSeqId)) {
|
if (this.messagesScroller && (prevState.topic != this.state.topic || prevState.maxSeqId != this.state.maxSeqId || prevState.minSeqId != this.state.minSeqId)) {
|
||||||
if (this.state.scrollPosition < SHOW_GO_TO_LAST_DIST) {
|
if (this.state.scrollPosition < SHOW_GO_TO_LAST_DIST) {
|
||||||
this.messagesScroller.scrollTop = this.messagesScroller.scrollHeight - this.state.scrollPosition - this.messagesScroller.offsetHeight;
|
this.messagesScroller.scrollTop = this.messagesScroller.scrollHeight - this.state.scrollPosition - this.messagesScroller.offsetHeight;
|
||||||
@@ -8001,7 +7991,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
}
|
}
|
||||||
} else if (what == 'read') {
|
} else if (what == 'read') {
|
||||||
this.resetContactList();
|
this.resetContactList();
|
||||||
} else if (what == 'msg') {
|
} else if (what == 'msg' && cont) {
|
||||||
const topic = this.tinode.getTopic(cont.topic);
|
const topic = this.tinode.getTopic(cont.topic);
|
||||||
const archived = topic && topic.isArchived();
|
const archived = topic && topic.isArchived();
|
||||||
if (cont.unread > 0 && this.state.messageSounds && !archived) {
|
if (cont.unread > 0 && this.state.messageSounds && !archived) {
|
||||||
@@ -8012,7 +8002,6 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
this.resetContactList();
|
this.resetContactList();
|
||||||
} else if (what == 'recv') {} else if (what == 'gone' || what == 'unsub') {
|
} else if (what == 'recv') {} else if (what == 'gone' || what == 'unsub') {
|
||||||
if (this.state.topicSelected == cont.topic) {
|
if (this.state.topicSelected == cont.topic) {
|
||||||
console.log("tnMeContactUpdate", cont.topic, what);
|
|
||||||
this.handleTopicSelected(null);
|
this.handleTopicSelected(null);
|
||||||
}
|
}
|
||||||
this.resetContactList();
|
this.resetContactList();
|
||||||
@@ -8023,7 +8012,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (what == 'del') {} else if (what == 'upd' || what == 'call') {} else {
|
} else if (what == 'del') {} else if (what == 'upd' || what == 'call') {} else {
|
||||||
console.info("Unsupported (yet) presence update:", what, "in", cont.topic);
|
console.info("Unsupported (yet) presence update:", what, "in", (cont || {}).topic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tnMeSubsUpdated(unused) {
|
tnMeSubsUpdated(unused) {
|
||||||
@@ -8125,6 +8114,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
topicSelected: null,
|
||||||
errorText: '',
|
errorText: '',
|
||||||
errorLevel: null,
|
errorLevel: null,
|
||||||
mobilePanel: 'sidepanel',
|
mobilePanel: 'sidepanel',
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-8
@@ -4505,7 +4505,6 @@ class TopicMe extends Topic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_routePres(pres) {
|
_routePres(pres) {
|
||||||
console.log("me._routePres", pres.what);
|
|
||||||
if (pres.what == 'term') {
|
if (pres.what == 'term') {
|
||||||
this._resetSub();
|
this._resetSub();
|
||||||
return;
|
return;
|
||||||
@@ -4529,7 +4528,6 @@ class TopicMe extends Topic {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'msg':
|
case 'msg':
|
||||||
console.log("me._routePres>_updateReceived", pres.seq, pres.act, cont._deleted);
|
|
||||||
cont._updateReceived(pres.seq, pres.act);
|
cont._updateReceived(pres.seq, pres.act);
|
||||||
break;
|
break;
|
||||||
case 'upd':
|
case 'upd':
|
||||||
@@ -4561,7 +4559,6 @@ class TopicMe extends Topic {
|
|||||||
break;
|
break;
|
||||||
case 'gone':
|
case 'gone':
|
||||||
this._tinode.cacheRemTopic(pres.src);
|
this._tinode.cacheRemTopic(pres.src);
|
||||||
console.log("gone, deleting", this._tinode.cacheGetTopic(pres.src));
|
|
||||||
if (!cont._deleted) {
|
if (!cont._deleted) {
|
||||||
cont._deleted = true;
|
cont._deleted = true;
|
||||||
cont._attached = false;
|
cont._attached = false;
|
||||||
@@ -4595,7 +4592,6 @@ class TopicMe extends Topic {
|
|||||||
} else if (pres.what == 'tags') {
|
} else if (pres.what == 'tags') {
|
||||||
this.getMeta(this.startMetaQuery().withTags().build());
|
this.getMeta(this.startMetaQuery().withTags().build());
|
||||||
} else if (pres.what == 'msg') {
|
} else if (pres.what == 'msg') {
|
||||||
console.log("me._routePres > this.getMeta", pres.src);
|
|
||||||
this.getMeta(this.startMetaQuery().withOneSub(undefined, pres.src).build());
|
this.getMeta(this.startMetaQuery().withOneSub(undefined, pres.src).build());
|
||||||
const dummy = this._tinode.getTopic(pres.src);
|
const dummy = this._tinode.getTopic(pres.src);
|
||||||
dummy._deleted = false;
|
dummy._deleted = false;
|
||||||
@@ -4849,7 +4845,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
/* harmony export */ "PACKAGE_VERSION": () => (/* binding */ PACKAGE_VERSION)
|
/* harmony export */ "PACKAGE_VERSION": () => (/* binding */ PACKAGE_VERSION)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
const PACKAGE_VERSION = "0.22.7";
|
const PACKAGE_VERSION = "0.22.8";
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
@@ -5575,9 +5571,6 @@ class Tinode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#cachePut(type, name, obj) {
|
#cachePut(type, name, obj) {
|
||||||
if (name == 'usrGosrQjv25RM') {
|
|
||||||
console.log("adding", type, "to cache", new Error("stacktrace"));
|
|
||||||
}
|
|
||||||
this._cache[type + ':' + name] = obj;
|
this._cache[type + ':' + name] = obj;
|
||||||
}
|
}
|
||||||
#cacheGet(type, name) {
|
#cacheGet(type, name) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user