Merge pull request 'fix: bug: Desktop Connect button never renders at 1280px width (#399)' (#402) from fix/issue-399 into master
This commit is contained in:
commit
71218464c0
2 changed files with 4 additions and 15 deletions
|
|
@ -29,20 +29,9 @@ export async function createWalletContext(
|
||||||
const address = wallet.address;
|
const address = wallet.address;
|
||||||
const chainIdHex = `0x${chainId.toString(16)}`;
|
const chainIdHex = `0x${chainId.toString(16)}`;
|
||||||
|
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext({
|
||||||
|
viewport: { width: 1280, height: 720 },
|
||||||
// Override screen.width to ensure desktop mode (the app uses screen.width for mobile detection)
|
screen: { width: 1280, height: 720 },
|
||||||
// In headless CI environments, screen.width may not match the viewport
|
|
||||||
await context.addInitScript(() => {
|
|
||||||
Object.defineProperty(window.screen, 'width', {
|
|
||||||
configurable: true,
|
|
||||||
value: 1280,
|
|
||||||
});
|
|
||||||
Object.defineProperty(window.screen, 'availWidth', {
|
|
||||||
configurable: true,
|
|
||||||
value: 1280,
|
|
||||||
});
|
|
||||||
console.info('[wallet-provider] Set screen.width to 1280 for desktop mode');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await context.addInitScript(() => {
|
await context.addInitScript(() => {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function useMobile() {
|
||||||
|
|
||||||
isMobile.value = isMobileFunc();
|
isMobile.value = isMobileFunc();
|
||||||
function isMobileFunc() {
|
function isMobileFunc() {
|
||||||
if (screen.width <= 768) {
|
if (window.innerWidth <= 768) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue