mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-28 05:19:49 +00:00
- dev ^0.86.4 at the root and in packages/apps; directives renamed by pezkuwi-dev-migrate-eslint10. - eslint --fix with the 0.86.4 config; one fix broke syntax (typescript-eslint prefer-optional-chain turned `(isStarted && onStart) && onStart()` into `(isStarted && onStart?.();` in TxButton) and is corrected by hand. - The remaining findings fixed rather than disabled: optional chains (each suggestion reviewed), `cause` on rethrown errors, `if` instead of `a && promise` in effects, parallel instead of sequential awaits in Promise.all, Error rejections, no `delete` on arrays (the storage query cache is a Map; an upload's file list no longer keeps a hole), no `[object Object]` stringification (TFunction's second argument is text or options), dead code removed (referenda's never-shown expand button, react-query's unused CoreDescriptor).
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/apps authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
import { MarkWarning, styled } from '@pezkuwi/react-components';
|
|
|
|
const BrowserCheckAlert: React.FC = () => {
|
|
const [isTargetBrowser, setIsTargetBrowser] = useState(false);
|
|
|
|
useEffect(() => {
|
|
const ua = navigator.userAgent;
|
|
|
|
// Detect Firefox
|
|
const firefoxMatch = /Firefox\/(\d+\.\d+)/.exec(ua);
|
|
|
|
if (firefoxMatch) {
|
|
// Check for Firefox 145.0 specifically
|
|
if (ua.includes('145.0')) {
|
|
setIsTargetBrowser(true);
|
|
}
|
|
}
|
|
}, []);
|
|
|
|
if (!isTargetBrowser) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<StyledBanner
|
|
className='warning centered'
|
|
withIcon={false}
|
|
>
|
|
|
|
The app is having some trouble running on Firefox v145.0. To keep everything running smoothly, please upgrade Firefox to the latest version or try using a different browser.
|
|
</StyledBanner>
|
|
);
|
|
};
|
|
|
|
const StyledBanner = styled(MarkWarning)`
|
|
border: 1px solid #ffc107;
|
|
background: #ffc10720;
|
|
font-size: 1rem !important;
|
|
margin-bottom: 5rem !important;
|
|
`;
|
|
|
|
export default BrowserCheckAlert;
|