fix(plugins): composer plugin-button selector returned a new array each render (zustand v5 infinite loop crashed the chat view) — select stable ref, filter in body
This commit is contained in:
parent
111a7a83e8
commit
1b497704e1
2 changed files with 5 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// Tchatou service worker — installable PWA + offline app shell.
|
||||
// Scope: /app/. Only handles same-origin /app/ GETs; the IRC websocket and all
|
||||
// API calls (cloudflare, change_password, upload) pass straight through.
|
||||
const CACHE = 'tchatou-v36';
|
||||
const CACHE = 'tchatou-v37';
|
||||
const SHELL = ['/app/', '/app/index.html', '/app/favicon.svg', '/app/orbit-icon.svg', '/app/manifest.webmanifest'];
|
||||
|
||||
self.addEventListener('install', (e) => {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ const SLASH_COMMANDS = ['me', 'msg', 'join', 'part', 'nick', 'whois', 'topic', '
|
|||
|
||||
export function Composer() {
|
||||
const { t } = useTranslation();
|
||||
const pluginButtons = usePluginRegistry((s) => s.ui.filter((u) => u.slot === 'composer_button'));
|
||||
// Select the stable array ref (zustand v5 would loop on a new array each render);
|
||||
// filter in the body.
|
||||
const pluginUi = usePluginRegistry((s) => s.ui);
|
||||
const pluginButtons = pluginUi.filter((u) => u.slot === 'composer_button');
|
||||
const active = useChat((s) => s.active);
|
||||
const send = useChat((s) => s.sendInput);
|
||||
const notifyTyping = useChat((s) => s.notifyTyping);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue