Skip to content

Commit da69a0f

Browse files
authored
Fix broken merge (#266)
1 parent 37ab1bc commit da69a0f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/model/model.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,7 +2630,7 @@ class MainSidebarModel {
26302630
});
26312631

26322632
setTempWidthAndTempCollapsed(newWidth: number, newCollapsed: boolean): void {
2633-
let width = Math.max(MagicLayout.MainSidebarMinWidth, Math.min(newWidth, MagicLayout.MainSidebarMaxWidth));
2633+
const width = Math.max(MagicLayout.MainSidebarMinWidth, Math.min(newWidth, MagicLayout.MainSidebarMaxWidth));
26342634

26352635
mobx.action(() => {
26362636
this.tempWidth.set(width);
@@ -2639,8 +2639,8 @@ class MainSidebarModel {
26392639
}
26402640

26412641
getWidth(): number {
2642-
let clientData = GlobalModel.clientData.get();
2643-
let width = clientData.clientopts.mainsidebar.width;
2642+
const clientData = GlobalModel.clientData.get();
2643+
let width = clientData?.clientopts?.mainsidebar?.width ?? MagicLayout.MainSidebarDefaultWidth;
26442644
if (this.isDragging.get()) {
26452645
if (this.tempWidth.get() == null && width == null) {
26462646
return MagicLayout.MainSidebarDefaultWidth;
@@ -2660,7 +2660,7 @@ class MainSidebarModel {
26602660
if (width <= MagicLayout.MainSidebarMinWidth) {
26612661
width = MagicLayout.MainSidebarDefaultWidth;
26622662
}
2663-
let snapPoint = MagicLayout.MainSidebarMinWidth + MagicLayout.MainSidebarSnapThreshold;
2663+
const snapPoint = MagicLayout.MainSidebarMinWidth + MagicLayout.MainSidebarSnapThreshold;
26642664
if (width < snapPoint || width > MagicLayout.MainSidebarMaxWidth) {
26652665
width = MagicLayout.MainSidebarDefaultWidth;
26662666
}
@@ -2672,8 +2672,8 @@ class MainSidebarModel {
26722672
}
26732673

26742674
getCollapsed(): boolean {
2675-
let clientData = GlobalModel.clientData.get();
2676-
let collapsed = clientData.clientopts.mainsidebar.collapsed;
2675+
const clientData = GlobalModel.clientData.get();
2676+
const collapsed = clientData?.clientopts?.mainsidebar?.collapsed;
26772677
if (this.isDragging.get()) {
26782678
if (this.tempCollapsed.get() == null && collapsed == null) {
26792679
return false;

0 commit comments

Comments
 (0)