fix(ui): проверить терминал и мобильный выбор устройства
This commit is contained in:
1 parent
ea4095d1f1
commit
8bda85129f
23 files changed
+102
-9
No files matched your search
@@ -67,9 +67,10 @@ function ServerRailMobileButton() {
|
||||
const { openRail, expandRail, collapsed, selectedLabel } = useServerRail()
|
||||
return (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className={collapsed ? undefined : "md:hidden"}
|
||||
className={cn("min-w-0 max-w-full",collapsed ? undefined : "md:hidden")}
|
||||
aria-label={collapsed ? "Показать список серверов" : "Серверы"}
|
||||
onClick={() => {
|
||||
if (window.matchMedia(DESKTOP_MQ).matches) {
|
||||
@@ -79,8 +80,8 @@ function ServerRailMobileButton() {
|
||||
openRail()
|
||||
}}
|
||||
>
|
||||
<ServerIcon data-icon="inline-start" />
|
||||
{selectedLabel}
|
||||
<ServerIcon aria-hidden="true" data-icon="inline-start" />
|
||||
<span className="min-w-0 truncate">{selectedLabel}</span>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
@@ -123,8 +124,9 @@ function ServerRailLayout({
|
||||
const [hydrated, setHydrated] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setCollapsed(readCollapsed())
|
||||
setHydrated(true)
|
||||
let cancelled=false
|
||||
queueMicrotask(()=>{if(cancelled)return;setCollapsed(readCollapsed());setHydrated(true)})
|
||||
return()=>{cancelled=true}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user