mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-19 04:41:37 +03:00
webterm: clean up component state derivation
This commit is contained in:
parent
329ec8ef3f
commit
d138ab254b
@ -6,8 +6,7 @@ import React, {
|
||||
import Helmet from 'react-helmet';
|
||||
|
||||
import useTermState from '~/logic/state/term';
|
||||
import useSettingsState from '~/logic/state/settings';
|
||||
import useLocalState from '~/logic/state/local';
|
||||
import { useDark } from '~/logic/state/join';
|
||||
|
||||
import { Terminal, ITerminalOptions, ITheme } from 'xterm';
|
||||
import { FitAddon } from 'xterm-addon-fit';
|
||||
@ -278,15 +277,8 @@ export default function TermApp(props: TermAppProps) {
|
||||
const container = useRef<HTMLDivElement>(null);
|
||||
// TODO allow switching of selected
|
||||
const { sessions, selected, slogstream, set } = useTermState();
|
||||
|
||||
const session = useTermState(useCallback(
|
||||
state => state.sessions[state.selected],
|
||||
[selected, sessions]
|
||||
));
|
||||
|
||||
const osDark = useLocalState(state => state.dark);
|
||||
const theme = useSettingsState(s => s.display.theme);
|
||||
const dark = theme === 'dark' || (theme === 'auto' && osDark);
|
||||
const session = sessions[selected];
|
||||
const dark = useDark();
|
||||
|
||||
const setupSlog = useCallback(() => {
|
||||
console.log('slog: setting up...');
|
||||
|
Loading…
Reference in New Issue
Block a user