Skip to content
Snippets Groups Projects
Commit 98873161 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix: twice click to maximize panel

parent 36071e07
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import { generalActionError } from "../actions";
import { userInterface } from "..";
import { selectors } from "../atlasSelection"
import * as actions from "./actions"
import { isNullish } from "src/util/fn";
@Injectable()
export class Effects{
......@@ -70,18 +71,23 @@ export class Effects{
)
),
switchMap(([ { targetIndex }, panelMode ]) => {
const newMode: userInterface.PanelMode = panelMode === "FOUR_PANEL"
let newMode: userInterface.PanelMode
if (isNullish(panelMode)) {
newMode = "PIP_PANEL"
} else {
newMode = panelMode === "FOUR_PANEL"
? "PIP_PANEL"
: "FOUR_PANEL"
}
const newOrder = newMode === "FOUR_PANEL"
? "0123"
: "0123".split("").map(v => ((Number(v) + targetIndex) % 4).toString()).join("")
return of(
userInterface.actions.setPanelMode({
panelMode: newMode
}),
userInterface.actions.setPanelOrder({
order: newOrder
}),
userInterface.actions.setPanelMode({
panelMode: newMode
})
)
})
......
......@@ -124,6 +124,7 @@ export class PerspectiveViewSlider {
),
]).pipe(
map(([ mode, order ]) => {
// TODO order can potentially be nullish
if (!([EnumPanelMode.PIP_PANEL, EnumPanelMode.SINGLE_PANEL].includes(mode as EnumPanelMode))) {
return null
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment