Compare commits

..

No commits in common. "8e8554331b39c6f8859c1a9fe17a8b6ee57f3023" and "147c9fbce19da9e5f4da27dc4b3a502fc7645bab" have entirely different histories.

2 changed files with 20 additions and 64 deletions

View file

@ -42,29 +42,6 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
calc(var(--safe-area-inset-bottom) + 20px) calc(var(--safe-area-inset-bottom) + 20px)
calc(var(--safe-area-inset-left) + 20px); calc(var(--safe-area-inset-left) + 20px);
} }
details {
max-width: 100vw;
max-width: 100dvw;
overflow: auto;
& * {
user-select: all;
}
summary {
position: sticky;
left: 0;
top: 0;
user-select: none;
}
}
.actions {
margin-top: 20px;
margin-bottom: 20px;
}
`; `;
return ( return (
@ -75,11 +52,8 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
You can restart the app to see if this guy is gone. If you meet this guy You can restart the app to see if this guy is gone. If you meet this guy
repeatly, please report to us. repeatly, please report to us.
</p> </p>
<div class="actions"> <div>
<Button <Button onClick={() => (window.location.replace("/"))}>
onClick={() => window.location.replace("/")}
variant="contained"
>
Restart App Restart App
</Button> </Button>
</div> </div>
@ -87,10 +61,7 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
<summary> <summary>
{errorMsg.loading ? "Generating " : " "}Technical Infomation {errorMsg.loading ? "Generating " : " "}Technical Infomation
</summary> </summary>
<pre> <pre>{errorMsg()}</pre>
On: {window.location.href} <br />
{errorMsg()}
</pre>
</details> </details>
</main> </main>
); );

View file

@ -294,9 +294,8 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
}; };
let reenterableAnimation: Animation | undefined; let reenterableAnimation: Animation | undefined;
let origWidth = 0, let origX = 0,
origFigX = 0, origWidth = 0;
origFigY = 0;
const resetAnimation = () => { const resetAnimation = () => {
reenterableAnimation = undefined; reenterableAnimation = undefined;
@ -308,25 +307,23 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
if (event.touches.length !== 1) { if (event.touches.length !== 1) {
return; return;
} }
event.stopPropagation();
const [fig0] = event.touches; const [fig0] = event.touches;
const { width } = event.currentTarget.getBoundingClientRect(); const { x, width } = event.currentTarget.getBoundingClientRect();
origWidth = width; if (fig0.clientX < x - 22 || fig0.clientX > x + 22) {
origFigX = fig0.clientX;
origFigY = fig0.clientY;
if (
fig0.clientX < -22 ||
fig0.clientX > 22 ||
fig0.clientX < window.innerWidth - 22 ||
fig0.clientX > window.innerWidth + 22
) {
return; return;
} }
// Prevent the default swipe to back/forward on iOS origX = x;
origWidth = width;
event.preventDefault(); event.preventDefault();
event.stopPropagation();
const lastFr = stack[stack.length - 1];
const createAnimation = lastFr.animateClose ?? animateClose;
reenterableAnimation = createAnimation(event.currentTarget);
reenterableAnimation.pause();
reenterableAnimation.addEventListener("finish", resetAnimation);
reenterableAnimation.addEventListener("cancel", resetAnimation);
}; };
const onDialogTouchMove = ( const onDialogTouchMove = (
@ -339,25 +336,13 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
} }
} }
const [fig0] = event.touches; if (!reenterableAnimation) return;
const ofsX = fig0.clientX - origFigX;
if (!reenterableAnimation) {
if (!(ofsX > 22) || !(Math.abs(fig0.clientY - origFigY) < 44)) {
return;
}
const lastFr = stack[stack.length - 1];
const createAnimation = lastFr.animateClose ?? animateClose;
reenterableAnimation = createAnimation(event.currentTarget);
reenterableAnimation.pause();
reenterableAnimation.addEventListener("finish", resetAnimation);
reenterableAnimation.addEventListener("cancel", resetAnimation);
}
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const [fig0] = event.touches;
const ofsX = fig0.clientX - origX;
const pc = ofsX / origWidth / window.devicePixelRatio; const pc = ofsX / origWidth / window.devicePixelRatio;
const { activeDuration, delay } = const { activeDuration, delay } =