diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fda479175b..ae2e03501a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -47,6 +47,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.x type=raw,value=latest,enable={{is_default_branch}} + type=ref,event=branch,enable=${{ github.event.repository.default_branch != github.ref }} - name: Build and push Docker images uses: docker/build-push-action@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 02db5f4bac..e846b96420 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +#### v3.1.2 (2023-05-12) + +##### Chores + +* incrementing version number - v3.1.1 (40250733) +* update changelog for v3.1.1 (ccd6f48c) +* incrementing version number - v3.1.0 (0cb386bd) +* incrementing version number - v3.0.1 (26f6ea49) +* incrementing version number - v3.0.0 (224e08cd) + +##### Bug Fixes + +* #11595, use default value (28740de7) + #### v3.1.1 (2023-05-11) ##### Chores diff --git a/install/package.json b/install/package.json index 7ee9baeec5..64ddcab998 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "3.1.1", + "version": "3.1.2", "homepage": "https://www.nodebb.org", "repository": { "type": "git", diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 98833e1e92..ecb724b3c9 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -235,15 +235,14 @@ define('forum/chats', [ } }); mousetrap.bind('up', function (e) { - if (e.target === components.get('chat/input').get(0)) { + const inputEl = components.get('chat/input'); + if (e.target === inputEl.get(0) && !inputEl.val()) { // Retrieve message id from messages list const message = components.get('chat/messages').find('.chat-message[data-self="1"]').last(); if (!message.length) { return; } const lastMid = message.attr('data-mid'); - const inputEl = components.get('chat/input'); - messages.prepEdit(inputEl, lastMid, ajaxify.data.roomId); } }); diff --git a/public/src/client/chats/messages.js b/public/src/client/chats/messages.js index fd530adaaf..1ad4c27323 100644 --- a/public/src/client/chats/messages.js +++ b/public/src/client/chats/messages.js @@ -176,6 +176,11 @@ define('forum/chats/messages', [ autoCompleteEl.destroy(); } } + textarea.on('keyup', (e) => { + if (e.key === 'Escape') { + finishEdit(); + } + }); editEl.find('[data-action="cancel"]').on('click', finishEdit); editEl.find('[data-action="save"]').on('click', function () { diff --git a/src/webserver.js b/src/webserver.js index 8a70a3a2e3..fe6d3ef984 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -197,13 +197,17 @@ function setupHelmet(app) { if (meta.config['hsts-enabled']) { options.hsts = { - maxAge: meta.config['hsts-maxage'], + maxAge: Math.max(0, meta.config['hsts-maxage']), includeSubDomains: !!meta.config['hsts-subdomains'], preload: !!meta.config['hsts-preload'], }; } - app.use(helmet(options)); + try { + app.use(helmet(options)); + } catch (err) { + winston.error(`[startup] unable to initialize helmet \n${err.stack}`); + } }