From b0186e0c9aa28d4a916aaff15437acd999c39f36 Mon Sep 17 00:00:00 2001 From: Aylong <69762909+AyIong@users.noreply.github.com> Date: Sun, 10 Mar 2024 09:41:03 +0200 Subject: [PATCH] fix: MaxTotalMessages (#165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Что этот PR делает Ну обосрался, бывает Забыл 1 значение изменить, из-за которого у всех новеньких 10к сообщений стояло --- tgui/packages/tgui-panel/settings/reducer.js | 2 +- tgui/public/tgui-panel.bundle.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui-panel/settings/reducer.js b/tgui/packages/tgui-panel/settings/reducer.js index 171359149e614..2d5bd8eb9c8cf 100644 --- a/tgui/packages/tgui-panel/settings/reducer.js +++ b/tgui/packages/tgui-panel/settings/reducer.js @@ -27,7 +27,7 @@ const initialState = { theme: 'dark', adminMusicVolume: 0.5, messageStackInSeconds: 30, - maxTotalMessage: 10000, + maxTotalMessage: 1500, // Keep these two state vars for compatibility with other servers highlightText: '', highlightColor: '#ffdd44', diff --git a/tgui/public/tgui-panel.bundle.js b/tgui/public/tgui-panel.bundle.js index e1908f4a7b0c8..86c755ad623bc 100644 --- a/tgui/public/tgui-panel.bundle.js +++ b/tgui/public/tgui-panel.bundle.js @@ -221,7 +221,7 @@ * @file * @copyright 2020 Aleksej Komarov * @license MIT - */function c(s,m){if(s==null)return{};var u={},v=Object.keys(s),f,g;for(g=0;g=0)&&(u[f]=s[f]);return u}var l=(0,r.createDefaultHighlightSetting)(),h={version:1,fontSize:13,fontFamily:o.FONTS[0],lineHeight:1.2,theme:"dark",adminMusicVolume:.5,messageStackInSeconds:30,maxTotalMessage:1e4,highlightText:"",highlightColor:"#ffdd44",highlightSettings:[l.id],highlightSettingById:(i={},i[l.id]=l,i),view:{visible:!1,activeTab:o.SETTINGS_TABS[0].id}},d=n.settingsReducer=function(){function s(m,u){m===void 0&&(m=h);var v=u.type,f=u.payload;if(v===e.updateSettings.type)return Object.assign({},m,f);if(v===e.loadSettings.type){if(!(f!=null&&f.version))return m;delete f.view;var g=Object.assign({},m,f);g.highlightSettings?g.highlightSettingById[l.id]||(g.highlightSettings=[l.id].concat(g.highlightSettings),g.highlightSettingById[l.id]=l):(g.highlightSettings=[l.id],g.highlightSettingById[l.id]=l);var p=g.highlightSettingById[l.id];return p.highlightColor=g.highlightColor,p.highlightText=g.highlightText,g}if(v===e.toggleSettings.type)return Object.assign({},m,{view:Object.assign({},m.view,{visible:!m.view.visible})});if(v===e.openChatSettings.type)return Object.assign({},m,{view:Object.assign({},m.view,{visible:!0,activeTab:"chatPage"})});if(v===e.changeSettingsTab.type){var S=f.tabId;return Object.assign({},m,{view:Object.assign({},m.view,{activeTab:S})})}if(v===e.addHighlightSetting.type){var O,T=f;return m.highlightSettings.length>=o.MAX_HIGHLIGHT_SETTINGS?m:Object.assign({},m,{highlightSettings:[].concat(m.highlightSettings,[T.id]),highlightSettingById:Object.assign({},m.highlightSettingById,(O={},O[T.id]=T,O))})}if(v===e.removeHighlightSetting.type){var C=f.id,E=Object.assign({},m,{highlightSettings:[].concat(m.highlightSettings),highlightSettingById:Object.assign({},m.highlightSettingById)});return C===l.id?E.highlightSettings[l.id]=l:(delete E.highlightSettingById[C],E.highlightSettings=E.highlightSettings.filter(function(N){return N!==C}),E.highlightSettings.length||(E.highlightSettings.push(l.id),E.highlightSettingById[l.id]=l)),E}if(v===e.updateHighlightSetting.type){var b=f.id,I=c(f,a),P=Object.assign({},m,{highlightSettings:[].concat(m.highlightSettings),highlightSettingById:Object.assign({},m.highlightSettingById)});return b===l.id&&(I.highlightText&&(P.highlightText=I.highlightText),I.highlightColor&&(P.highlightColor=I.highlightColor)),P.highlightSettingById[b]&&(P.highlightSettingById[b]=Object.assign({},P.highlightSettingById[b],I)),P}return m}return s}()},65910:function(y,n){"use strict";n.__esModule=!0,n.selectSettings=n.selectHighlightSettings=n.selectHighlightSettingById=n.selectActiveTab=void 0;/** + */function c(s,m){if(s==null)return{};var u={},v=Object.keys(s),f,g;for(g=0;g=0)&&(u[f]=s[f]);return u}var l=(0,r.createDefaultHighlightSetting)(),h={version:1,fontSize:13,fontFamily:o.FONTS[0],lineHeight:1.2,theme:"dark",adminMusicVolume:.5,messageStackInSeconds:30,maxTotalMessage:1500,highlightText:"",highlightColor:"#ffdd44",highlightSettings:[l.id],highlightSettingById:(i={},i[l.id]=l,i),view:{visible:!1,activeTab:o.SETTINGS_TABS[0].id}},d=n.settingsReducer=function(){function s(m,u){m===void 0&&(m=h);var v=u.type,f=u.payload;if(v===e.updateSettings.type)return Object.assign({},m,f);if(v===e.loadSettings.type){if(!(f!=null&&f.version))return m;delete f.view;var g=Object.assign({},m,f);g.highlightSettings?g.highlightSettingById[l.id]||(g.highlightSettings=[l.id].concat(g.highlightSettings),g.highlightSettingById[l.id]=l):(g.highlightSettings=[l.id],g.highlightSettingById[l.id]=l);var p=g.highlightSettingById[l.id];return p.highlightColor=g.highlightColor,p.highlightText=g.highlightText,g}if(v===e.toggleSettings.type)return Object.assign({},m,{view:Object.assign({},m.view,{visible:!m.view.visible})});if(v===e.openChatSettings.type)return Object.assign({},m,{view:Object.assign({},m.view,{visible:!0,activeTab:"chatPage"})});if(v===e.changeSettingsTab.type){var S=f.tabId;return Object.assign({},m,{view:Object.assign({},m.view,{activeTab:S})})}if(v===e.addHighlightSetting.type){var O,T=f;return m.highlightSettings.length>=o.MAX_HIGHLIGHT_SETTINGS?m:Object.assign({},m,{highlightSettings:[].concat(m.highlightSettings,[T.id]),highlightSettingById:Object.assign({},m.highlightSettingById,(O={},O[T.id]=T,O))})}if(v===e.removeHighlightSetting.type){var C=f.id,E=Object.assign({},m,{highlightSettings:[].concat(m.highlightSettings),highlightSettingById:Object.assign({},m.highlightSettingById)});return C===l.id?E.highlightSettings[l.id]=l:(delete E.highlightSettingById[C],E.highlightSettings=E.highlightSettings.filter(function(N){return N!==C}),E.highlightSettings.length||(E.highlightSettings.push(l.id),E.highlightSettingById[l.id]=l)),E}if(v===e.updateHighlightSetting.type){var b=f.id,I=c(f,a),P=Object.assign({},m,{highlightSettings:[].concat(m.highlightSettings),highlightSettingById:Object.assign({},m.highlightSettingById)});return b===l.id&&(I.highlightText&&(P.highlightText=I.highlightText),I.highlightColor&&(P.highlightColor=I.highlightColor)),P.highlightSettingById[b]&&(P.highlightSettingById[b]=Object.assign({},P.highlightSettingById[b],I)),P}return m}return s}()},65910:function(y,n){"use strict";n.__esModule=!0,n.selectSettings=n.selectHighlightSettings=n.selectHighlightSettingById=n.selectActiveTab=void 0;/** * @file * @copyright 2020 Aleksej Komarov * @license MIT