From 3c0290588ca1ec951775aef4aab5406fd6947ca8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 5 Jun 2017 16:17:32 +0100 Subject: [PATCH 1/4] Always show the spinner during the first sync Before, we were relying on the fact that `ready` would still have been false from before. This was not the case, for example, if we naviagted straight to /#/login (which causes a guest session to be set up and the sync for that completes after we navigate to the login screen). We should always mark ourselves as not-ready after login since we will always have to wait for the sync. --- src/components/structures/MatrixChat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 72a745107e..e3792410b2 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -507,7 +507,7 @@ module.exports = React.createClass({ this._onSetTheme(payload.value); break; case 'on_logging_in': - this.setState({loggingIn: true}); + this.setState({loggingIn: true, ready: false}); break; case 'on_logged_in': this._onLoggedIn(payload.teamToken); From 3dbea45426fdace08e68982373fce5ef4c176e6d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 5 Jun 2017 16:50:00 +0100 Subject: [PATCH 2/4] Comment --- src/components/structures/MatrixChat.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index e3792410b2..c4d3df03d3 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -507,6 +507,10 @@ module.exports = React.createClass({ this._onSetTheme(payload.value); break; case 'on_logging_in': + // We are now logging in, so set the state to reflect that + // and also that we're not ready (we'll be marked as logged + // in once the login completes, then ready once the sync + // completes). this.setState({loggingIn: true, ready: false}); break; case 'on_logged_in': From d77a09adbafca12393c8cb25ec7c541a6fe70b04 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 5 Jun 2017 21:32:51 +0100 Subject: [PATCH 3/4] quick and dirty override to disable MD globally --- src/components/views/rooms/MessageComposerInputOld.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MessageComposerInputOld.js b/src/components/views/rooms/MessageComposerInputOld.js index f6af20c03b..80fb51e6b5 100644 --- a/src/components/views/rooms/MessageComposerInputOld.js +++ b/src/components/views/rooms/MessageComposerInputOld.js @@ -29,7 +29,6 @@ var Markdown = require("../../../Markdown"); var TYPING_USER_TIMEOUT = 10000; var TYPING_SERVER_TIMEOUT = 30000; -var MARKDOWN_ENABLED = true; export function onSendMessageFailed(err, room) { // XXX: temporary logging to try to diagnose @@ -77,7 +76,8 @@ export default React.createClass({ componentWillMount: function() { this.oldScrollHeight = 0; - this.markdownEnabled = MARKDOWN_ENABLED; + this.markdownEnabled = !UserSettingsStore.getSyncedSetting('disableMarkdown', false); + var self = this; this.sentHistory = { // The list of typed messages. Index 0 is more recent From ed7c138d91ee0f521e96fe1a4faf60dd8fd5cfde Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 5 Jun 2017 21:38:25 +0100 Subject: [PATCH 4/4] quick and dirty override to disable MD globally --- src/components/structures/UserSettings.js | 4 ++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 5 insertions(+) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 89debcb461..6cb262e79a 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -88,6 +88,10 @@ const SETTINGS_LABELS = [ id: 'hideRedactions', label: 'Hide removed messages', }, + { + id: 'disableMarkdown', + label: 'Disable markdown formatting', + }, /* { id: 'useFixedWidthFont', diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2bef4b8901..6a7c510544 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -241,6 +241,7 @@ "Direct chats": "Direct chats", "disabled": "disabled", "Disable inline URL previews by default": "Disable inline URL previews by default", + "Disable markdown formatting": "Disable markdown formatting", "Disinvite": "Disinvite", "Display name": "Display name", "Displays action": "Displays action",