Skip to content

Commit

Permalink
Fix problem with pinch zoom and long-press (#4734)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianjelfs authored Nov 8, 2023
1 parent 40bee73 commit e68669a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions frontend/app/src/actions/longpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export function longpress(node: HTMLElement, onlongpress: () => void) {

function onTouchStart(e: TouchEvent) {
const t = e.changedTouches[0];
startX = t.clientX;
startY = t.clientY;
startX = t.screenX;
startY = t.screenY;
clearLongPressTimer();
longPressTimer = window.setTimeout(() => {
const lastScroll = get(eventListLastScrolled);
Expand All @@ -29,8 +29,8 @@ export function longpress(node: HTMLElement, onlongpress: () => void) {
}

function onTouchMove({ changedTouches: [t] }: TouchEvent) {
const diffX = Math.abs(startX - t.clientX);
const diffY = Math.abs(startY - t.clientY);
const diffX = Math.abs(startX - t.screenX);
const diffY = Math.abs(startY - t.screenY);
if (diffX >= 10 || diffY >= 10) {
clearLongPressTimer();
}
Expand Down
4 changes: 0 additions & 4 deletions frontend/app/src/components/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import SwitchDomain from "./SwitchDomain.svelte";
import Upgrading from "./upgrading/Upgrading.svelte";
import UpgradeBanner from "./UpgradeBanner.svelte";
import { mobileOperatingSystem } from "../utils/devices";
import { currentTheme } from "../theme/themes";
import "../stores/fontSize";
import Profiler from "./Profiler.svelte";
Expand Down Expand Up @@ -80,9 +79,6 @@
if (client.captureReferralCode()) {
page.replace(removeQueryStringParam("ref"));
}
if (mobileOperatingSystem === "iOS") {
viewPortContent += ", maximum-scale=1";
}
calculateHeight();
window.addEventListener("orientationchange", calculateHeight);
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/src/components/home/AccountInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
export let ledger: string;
export let centered = false;
export let border = true;
export let fullWidthOnMobile: boolean = false;
$: cryptoLookup = client.cryptoLookup;
$: tokenDetails = $cryptoLookup[ledger];
Expand Down Expand Up @@ -43,7 +44,7 @@
</script>

<div class="account-info">
<QRCode text={account} size={qrSize} logo={tokenDetails.logo} {border} />
<QRCode {fullWidthOnMobile} text={account} size={qrSize} logo={tokenDetails.logo} {border} />
<p class="your-account" class:centered>
{$_("tokenTransfer.yourAccount", { values: { token: symbol } })}
</p>
Expand Down
7 changes: 6 additions & 1 deletion frontend/app/src/components/home/upgrade/Payment.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@
{/each}
</div>
<div class="right">
<AccountInfo border={false} centered {ledger} user={client.user} />
<AccountInfo
fullWidthOnMobile
border={false}
centered
{ledger}
user={client.user} />
</div>
</div>

Expand Down

0 comments on commit e68669a

Please sign in to comment.