This commit is contained in:
or-else
2023-05-10 13:20:40 -07:00
parent c15092e850
commit 852a1a7c4e
11 changed files with 14 additions and 43 deletions
+1 -1
View File
@@ -71,7 +71,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.3.0",
"tinode-sdk": "^0.22.7",
"tinode-sdk": "^0.22.8",
"webm-duration-fix": "^1.0.4"
},
"devDependencies": {
-12
View File
@@ -209,18 +209,6 @@ class MessagesView extends React.Component {
}
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
// or vertical shrinking.
if (this.messagesScroller &&
+3 -3
View File
@@ -848,7 +848,7 @@ class TinodeWeb extends React.Component {
}
} else if (what == 'read') {
this.resetContactList();
} else if (what == 'msg') {
} else if (what == 'msg' && cont) {
// Check if the topic is archived. If so, don't play a sound.
const topic = this.tinode.getTopic(cont.topic);
const archived = topic && topic.isArchived();
@@ -870,7 +870,6 @@ class TinodeWeb extends React.Component {
// Topic deleted or user unsubscribed. Remove topic from view.
// If the currently selected topic is gone, clear the selection.
if (this.state.topicSelected == cont.topic) {
console.log("tnMeContactUpdate", cont.topic, what);
this.handleTopicSelected(null);
}
// Redraw without the deleted topic.
@@ -888,7 +887,7 @@ class TinodeWeb extends React.Component {
} else {
// TODO(gene): handle other types of notifications:
// * 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 {
// Currently selected contact deleted
this.setState({
topicSelected: null,
errorText: '',
errorLevel: null,
mobilePanel: 'sidepanel',
+3 -13
View File
@@ -5263,16 +5263,6 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
}
}
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.state.scrollPosition < SHOW_GO_TO_LAST_DIST) {
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') {
this.resetContactList();
} else if (what == 'msg') {
} else if (what == 'msg' && cont) {
const topic = this.tinode.getTopic(cont.topic);
const archived = topic && topic.isArchived();
if (cont.unread > 0 && this.state.messageSounds && !archived) {
@@ -8012,7 +8002,6 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.resetContactList();
} else if (what == 'recv') {} else if (what == 'gone' || what == 'unsub') {
if (this.state.topicSelected == cont.topic) {
console.log("tnMeContactUpdate", cont.topic, what);
this.handleTopicSelected(null);
}
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 {
console.info("Unsupported (yet) presence update:", what, "in", cont.topic);
console.info("Unsupported (yet) presence update:", what, "in", (cont || {}).topic);
}
}
tnMeSubsUpdated(unused) {
@@ -8125,6 +8114,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
} else {
this.setState({
topicSelected: null,
errorText: '',
errorLevel: null,
mobilePanel: 'sidepanel',
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -8
View File
@@ -4505,7 +4505,6 @@ class TopicMe extends Topic {
}
}
_routePres(pres) {
console.log("me._routePres", pres.what);
if (pres.what == 'term') {
this._resetSub();
return;
@@ -4529,7 +4528,6 @@ class TopicMe extends Topic {
}
break;
case 'msg':
console.log("me._routePres>_updateReceived", pres.seq, pres.act, cont._deleted);
cont._updateReceived(pres.seq, pres.act);
break;
case 'upd':
@@ -4561,7 +4559,6 @@ class TopicMe extends Topic {
break;
case 'gone':
this._tinode.cacheRemTopic(pres.src);
console.log("gone, deleting", this._tinode.cacheGetTopic(pres.src));
if (!cont._deleted) {
cont._deleted = true;
cont._attached = false;
@@ -4595,7 +4592,6 @@ class TopicMe extends Topic {
} else if (pres.what == 'tags') {
this.getMeta(this.startMetaQuery().withTags().build());
} else if (pres.what == 'msg') {
console.log("me._routePres > this.getMeta", pres.src);
this.getMeta(this.startMetaQuery().withOneSub(undefined, pres.src).build());
const dummy = this._tinode.getTopic(pres.src);
dummy._deleted = false;
@@ -4849,7 +4845,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "PACKAGE_VERSION": () => (/* binding */ PACKAGE_VERSION)
/* harmony export */ });
const PACKAGE_VERSION = "0.22.7";
const PACKAGE_VERSION = "0.22.8";
/***/ })
@@ -5575,9 +5571,6 @@ class Tinode {
}
}
#cachePut(type, name, obj) {
if (name == 'usrGosrQjv25RM') {
console.log("adding", type, "to cache", new Error("stacktrace"));
}
this._cache[type + ':' + name] = obj;
}
#cacheGet(type, name) {
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long