topic redirects work now, bug with starting topic from search results fixed
This commit is contained in:
@@ -726,7 +726,7 @@ class TinodeWeb extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// User clicked on a contact in the side panel or deleted a contact.
|
// User clicked on a contact in the side panel or deleted a contact.
|
||||||
handleTopicSelected(topicName, unused_index, online, acs) {
|
handleTopicSelected(topicName) {
|
||||||
// Clear newTopicParams after use.
|
// Clear newTopicParams after use.
|
||||||
if (this.state.newTopicParams && this.state.newTopicParams._topicName != topicName) {
|
if (this.state.newTopicParams && this.state.newTopicParams._topicName != topicName) {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -744,8 +744,8 @@ class TinodeWeb extends React.Component {
|
|||||||
// Different contact selected.
|
// Different contact selected.
|
||||||
if (this.state.topicSelected != topicName) {
|
if (this.state.topicSelected != topicName) {
|
||||||
this.setState({
|
this.setState({
|
||||||
topicSelectedOnline: online,
|
topicSelectedOnline: this.tinode.isTopicOnline(topicName),
|
||||||
topicSelectedAcs: acs
|
topicSelectedAcs: this.tinode.getTopicAccessMode(topicName)
|
||||||
});
|
});
|
||||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic('', topicName));
|
HashNavigation.navigateTo(HashNavigation.setUrlTopic('', topicName));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ export default class Contact extends React.Component {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (this.props.onSelected) {
|
if (this.props.onSelected) {
|
||||||
this.props.onSelected(this.props.item, this.props.index, this.props.now, this.props.acs);
|
// Index this.props.index is used by GroupManager.
|
||||||
|
this.props.onSelected(this.props.item, this.props.index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+25
-16
@@ -3012,7 +3012,6 @@ class MessagesView extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Componen
|
|||||||
const setQuery = newTopic ? this.props.newTopicParams : undefined;
|
const setQuery = newTopic ? this.props.newTopicParams : undefined;
|
||||||
topic.subscribe(getQuery.build(), setQuery).then(ctrl => {
|
topic.subscribe(getQuery.build(), setQuery).then(ctrl => {
|
||||||
if (ctrl.code == 303) {
|
if (ctrl.code == 303) {
|
||||||
console.log("Redirecting to", ctrl.params.topic);
|
|
||||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].setUrlTopic('', ctrl.params.topic));
|
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].setUrlTopic('', ctrl.params.topic));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3879,7 +3878,7 @@ class NewTopicView extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Componen
|
|||||||
handleContactSelected(sel) {
|
handleContactSelected(sel) {
|
||||||
if (this.state.tabSelected === 'p2p') {
|
if (this.state.tabSelected === 'p2p') {
|
||||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_7__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_7__["default"].removeUrlParam(window.location.hash, 'tab'));
|
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_7__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_7__["default"].removeUrlParam(window.location.hash, 'tab'));
|
||||||
this.props.onCreateTopic(sel, undefined);
|
this.props.onCreateTopic(sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4546,7 +4545,7 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
this.togglePushToken = this.togglePushToken.bind(this);
|
this.togglePushToken = this.togglePushToken.bind(this);
|
||||||
this.requestPushToken = this.requestPushToken.bind(this);
|
this.requestPushToken = this.requestPushToken.bind(this);
|
||||||
this.handleSidepanelCancel = this.handleSidepanelCancel.bind(this);
|
this.handleSidepanelCancel = this.handleSidepanelCancel.bind(this);
|
||||||
this.handleNewTopicRequest = this.handleNewTopicRequest.bind(this);
|
this.handleStartTopicRequest = this.handleStartTopicRequest.bind(this);
|
||||||
this.handleNewTopicCreated = this.handleNewTopicCreated.bind(this);
|
this.handleNewTopicCreated = this.handleNewTopicCreated.bind(this);
|
||||||
this.handleTopicUpdateRequest = this.handleTopicUpdateRequest.bind(this);
|
this.handleTopicUpdateRequest = this.handleTopicUpdateRequest.bind(this);
|
||||||
this.handleChangePermissions = this.handleChangePermissions.bind(this);
|
this.handleChangePermissions = this.handleChangePermissions.bind(this);
|
||||||
@@ -5065,7 +5064,7 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
const merged = {};
|
const merged = {};
|
||||||
|
|
||||||
for (const c of chatList) {
|
for (const c of chatList) {
|
||||||
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.topicType(c.topic) == 'p2p') {
|
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.isP2PTopicName(c.topic)) {
|
||||||
merged[c.topic] = {
|
merged[c.topic] = {
|
||||||
user: c.topic,
|
user: c.topic,
|
||||||
updated: c.updated,
|
updated: c.updated,
|
||||||
@@ -5155,7 +5154,9 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleTopicSelected(topicName, unused_index, online, acs) {
|
handleTopicSelected(topicName) {
|
||||||
|
console.log("handleTopicSelected", topicName, new Error("stacktrace"));
|
||||||
|
|
||||||
if (this.state.newTopicParams && this.state.newTopicParams._topicName != topicName) {
|
if (this.state.newTopicParams && this.state.newTopicParams._topicName != topicName) {
|
||||||
this.setState({
|
this.setState({
|
||||||
newTopicParams: null
|
newTopicParams: null
|
||||||
@@ -5172,8 +5173,8 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
|
|
||||||
if (this.state.topicSelected != topicName) {
|
if (this.state.topicSelected != topicName) {
|
||||||
this.setState({
|
this.setState({
|
||||||
topicSelectedOnline: online,
|
topicSelectedOnline: this.tinode.isTopicOnline(topicName),
|
||||||
topicSelectedAcs: acs
|
topicSelectedAcs: this.tinode.getTopicAccessMode(topicName)
|
||||||
});
|
});
|
||||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].setUrlTopic('', topicName));
|
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].setUrlTopic('', topicName));
|
||||||
}
|
}
|
||||||
@@ -5240,7 +5241,7 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (topic.getType() == 'p2p') {
|
if (topic.isP2P()) {
|
||||||
response = response.then(ctrl => {
|
response = response.then(ctrl => {
|
||||||
topic.setMeta({
|
topic.setMeta({
|
||||||
sub: {
|
sub: {
|
||||||
@@ -5527,13 +5528,18 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].setUrlSidePanel(window.location.hash, hash));
|
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].setUrlSidePanel(window.location.hash, hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
handleNewTopicRequest(peerName, pub, priv, tags, isChannel) {
|
handleStartTopicRequest(topicName, pub, priv, tags, isChannel) {
|
||||||
const topicName = peerName || this.tinode.newGroupTopicName(isChannel);
|
console.log("handleStartTopicRequest", topicName);
|
||||||
const params = {
|
|
||||||
_topicName: topicName
|
|
||||||
};
|
|
||||||
|
|
||||||
if (peerName) {
|
if (topicName && this.tinode.getTopic(topicName)) {
|
||||||
|
this.handleTopicSelected(topicName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const params = {};
|
||||||
|
|
||||||
|
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.isP2PTopicName(topicName)) {
|
||||||
|
console.log("P2P topic", topicName);
|
||||||
params.sub = {
|
params.sub = {
|
||||||
mode: _config_js__WEBPACK_IMPORTED_MODULE_11__["DEFAULT_P2P_ACCESS_MODE"]
|
mode: _config_js__WEBPACK_IMPORTED_MODULE_11__["DEFAULT_P2P_ACCESS_MODE"]
|
||||||
};
|
};
|
||||||
@@ -5543,6 +5549,7 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
topicName = topicName || this.tinode.newGroupTopicName(isChannel);
|
||||||
params.desc = {
|
params.desc = {
|
||||||
public: pub,
|
public: pub,
|
||||||
private: {
|
private: {
|
||||||
@@ -5550,8 +5557,10 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
params.tags = tags;
|
params.tags = tags;
|
||||||
|
console.log("Grp topic", topicName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params._topicName = topicName;
|
||||||
this.setState({
|
this.setState({
|
||||||
newTopicParams: params
|
newTopicParams: params
|
||||||
}, () => {
|
}, () => {
|
||||||
@@ -5966,7 +5975,7 @@ class TinodeWeb extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
onCredDelete: this.handleCredDelete,
|
onCredDelete: this.handleCredDelete,
|
||||||
onCredConfirm: this.handleCredConfirm,
|
onCredConfirm: this.handleCredConfirm,
|
||||||
onTopicSelected: this.handleTopicSelected,
|
onTopicSelected: this.handleTopicSelected,
|
||||||
onCreateTopic: this.handleNewTopicRequest,
|
onCreateTopic: this.handleStartTopicRequest,
|
||||||
onLogout: this.handleLogout,
|
onLogout: this.handleLogout,
|
||||||
onDeleteAccount: this.handleDeleteAccount,
|
onDeleteAccount: this.handleDeleteAccount,
|
||||||
onShowAlert: this.handleShowAlert,
|
onShowAlert: this.handleShowAlert,
|
||||||
@@ -7228,7 +7237,7 @@ class Contact extends react__WEBPACK_IMPORTED_MODULE_0___default.a.Component {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (this.props.onSelected) {
|
if (this.props.onSelected) {
|
||||||
this.props.onSelected(this.props.item, this.props.index, this.props.now, this.props.acs);
|
this.props.onSelected(this.props.item, this.props.index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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
+67
-10
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user