Files
Bubberstation/tgui/packages/tgui-panel/chat/actions.js
SkyratBot 7493362fb1 [MIRROR] allows to reorder chat tabs & hides delete from main tab (#26571)
allows to reorder chat tabs & hides delete from main tab (#81455)

## About The Pull Request
This pull request aims to hide the delete button from the main chat tab
as well as to allow reordering of the other chat tabs.
((Not to cause any issues with existing tabs, the variable has to be
true, so the hiding of the delete button only takes effect for new
players or when someone deleted all tabs once))

![grafik](https://github.com/tgstation/tgstation/assets/144968721/c1682cef-3e4f-4c4f-8394-bbf1345d4630)

![grafik](https://github.com/tgstation/tgstation/assets/144968721/ffe973a5-24eb-44ed-b8db-e3c1867935d1)
## Why It's Good For The Game
- I'm not quite sure, why the main tab has the delete button in the
first place, after all, it's not like the tab should be removed?
So, we can just hide the delete button on that tab and keep it always
there.
- Accidentally deleting a chat tab when one has multiple tabs set up
requires to change all tabs to the right to regain the previous order,
so why not simply allow to reorder all tabs except for the main tab.
(The main tab can neither be moved, nor can anything swapped with it)
## Changelog
🆑
qol: hides the delete button on the main tab allows to reorder all other
chat tabs
/🆑

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2024-02-21 20:37:08 +01:00

26 lines
1.0 KiB
JavaScript

/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
*/
import { createAction } from 'common/redux';
import { createPage } from './model';
export const loadChat = createAction('chat/load');
export const rebuildChat = createAction('chat/rebuild');
export const clearChat = createAction('chat/clear');
export const updateMessageCount = createAction('chat/updateMessageCount');
export const addChatPage = createAction('chat/addPage', () => ({
payload: createPage(),
}));
export const changeChatPage = createAction('chat/changePage');
export const updateChatPage = createAction('chat/updatePage');
export const toggleAcceptedType = createAction('chat/toggleAcceptedType');
export const removeChatPage = createAction('chat/removePage');
export const changeScrollTracking = createAction('chat/changeScrollTracking');
export const saveChatToDisk = createAction('chat/saveToDisk');
export const moveChatPageLeft = createAction('chat/movePageLeft');
export const moveChatPageRight = createAction('chat/movePageRight');